Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Problems with UTF characters

Aperta
#205 1 commento 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, node.js
Ambito
backend

Direzione di ricerca

Start at src/index.js around line 754, where the Content-Disposition header is written, and reproduce the failure with the linked minimal demo using node server.js. Compare the filename handling with RFC 5987 and verify that serving DALL·E 2024-01-17.png no longer raises Node's invalid-header error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

I put together a minimal demo

  • node Version: 20.5.1 (also tested on 20.11.0 FROM node:20-slim)
  • npm version: 10.2.5
  • OS: MacOs 12.7.2
  • Browser: Firefox 121.0.1
Lingua principale
JavaScript
Stelle
618
Fork
117
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vercel/serve-handler

Tutte le issue di vercel/serve-handler

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.