Skip to content

Regression on handling images with non-ASCII chars in filename #187

@zigarn

Description

@zigarn

Last automatic build of training-continuous-integration suddenly failed: https://app.circleci.com/pipelines/github/Zenika-Training/training-continuous-integration/213/workflows/2e616255-b848-41df-8955-21a6b3ec7375/jobs/512

Loading page http://localhost:35903/slides.html ...
/app/src/cli/cli.js:187
  throw err;
  ^

TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Content-Disposition"]
    at storeHeader (node:_http_outgoing:573:5)
    at processHeader (node:_http_outgoing:568:3)
    at ServerResponse._storeHeader (node:_http_outgoing:449:11)
    at ServerResponse.writeHead (node:_http_server:417:8)
    at module.exports (/app/node_modules/serve-handler/src/index.js:754:11) {
  code: 'ERR_INVALID_CHAR'
}

After a bit of debug, found that the issue comes from header 'Content-Disposition': 'inline; filename="Processus-intégration-livraison-5c96e38fe490eab5178d..png"', so with é in path.

Looks like latest build of sensei changed behavior on handling non-ASCII chars in filename.

Example on how removing non-ASCII chars in filenames fixes the problem: https://github.com/Zenika-Training/training-continuous-integration/commit/60d97613f786bbbd079a09d0baf81599277271b2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions