Fix wget with text file target

This commit is contained in:
Snarling 2023-04-28 11:14:29 -04:00
parent aa7facd4ba
commit 8fd4eee8e9

@ -1628,7 +1628,7 @@ export const ns: InternalAPI<NSFull> = {
}, },
wget: (ctx) => async (_url, _target, _hostname) => { wget: (ctx) => async (_url, _target, _hostname) => {
const url = helpers.string(ctx, "url", _url); const url = helpers.string(ctx, "url", _url);
const target = helpers.scriptPath(ctx, "target", _target); const target = helpers.filePath(ctx, "target", _target);
const hostname = _hostname ? helpers.string(ctx, "hostname", _hostname) : ctx.workerScript.hostname; const hostname = _hostname ? helpers.string(ctx, "hostname", _hostname) : ctx.workerScript.hostname;
const server = helpers.getServer(ctx, hostname); const server = helpers.getServer(ctx, hostname);
if (!target || (!hasTextExtension(target) && !hasScriptExtension(target))) { if (!target || (!hasTextExtension(target) && !hasScriptExtension(target))) {