You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working on a page that would take an arbitrary text input from a user and redirect them to a domain with the location header set to the data input. However, this call generates an Internal error when called with a location that exceeds the limit of the location header. It dies not throw an error on the JS/TS side which could be handled.
Example code:
exportdefault{asyncfetch(request,env,ctx): Promise<Response>{varredirectUrl=String(newURL(request.url+"*long data, like entire bee movie script here*"))try{returnResponse.redirect(redirectUrl)}catch(err){console.log(err)}},}satisfiesExportedHandler<Env>;
Expected behavior:
The Response.redirect() throws an error which is handled (in this case logged to console), and the program continues
Current behavior:
The process throws an internal error:
Error: internal error
at async Object.fetch (file:///home/frigyes/qr-code-generator/node_modules/miniflare/dist/src/workers/core/entry.worker.js:1029:22)
I was working on a page that would take an arbitrary text input from a user and redirect them to a domain with the location header set to the data input. However, this call generates an Internal error when called with a location that exceeds the limit of the location header. It dies not throw an error on the JS/TS side which could be handled.
Example code:
Expected behavior:
The Response.redirect() throws an error which is handled (in this case logged to console), and the program continues
Current behavior:
The process throws an internal error:
Wrangler logs:
Error when run on CF Workers:
I might be totally in the wrong here, but I would expect the function to throw at least a generic error instead of crashing and burning.
Please let me know if I'm dumb and/or if you need more details.
Frigyes
The text was updated successfully, but these errors were encountered: