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 think serve-handler isn't implementing RFC 5987 correctly.
When I attempt to serve a file with the name DALL·E 2024-01-17.png (note the bullet point) I get the following error:
$ node server.js
Server running at http://localhost:3000/
node:internal/errors:496
ErrorCaptureStackTrace(err);
^
TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Content-Disposition"]
at storeHeader (node:_http_outgoing:580:5)
at processHeader (node:_http_outgoing:575:3)
at ServerResponse._storeHeader (node:_http_outgoing:451:11)
at ServerResponse.writeHead (node:_http_server:422:8)
at module.exports (/Users/djotto/projects/test-serve-handler/node_modules/serve-handler/src/index.js:754:11) {
code: 'ERR_INVALID_CHAR'
}
Node.js v20.5.1
When a file url has certain symbols like number sign (#), it doesn't encode them, which makes the browser fail to navigate to the file, thinking it is a document section. This commit fixes that by encoding urls using the built-in encodeURIComponent function.
Fixesvercel#120, vercel#205, vercel/serve#726, and vercel/serve#774
I think serve-handler isn't implementing RFC 5987 correctly.
When I attempt to serve a file with the name
DALL·E 2024-01-17.png
(note the bullet point) I get the following error:I put together a minimal demo
The text was updated successfully, but these errors were encountered: