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
a header value with non-ascii characters is passed without encoding it. nodejs/node#46528 this PR solved the behaviour mismatch in encoding when using content length. @ShogunPanda
Even once the header is encoded it still fails. I noticed that undici always encodes the content-disposition header to latin1, even if there is no content-length header too, but fixing that still doesn't pass the test either ☹️.
Activity
targos commentedon Mar 22, 2023
Recent CITGM run (v19.8.0): https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/3139/nodes=fedora-latest-x64/testReport/junit/(root)/citgm/undici_v5_21_0/
KhafraDev commentedon Mar 22, 2023
This is the failing test https://github.com/nodejs/undici/blob/main/test/issue-1903.js
RishabhKodes commentedon Mar 22, 2023
Failure logs https://github.com/nodejs/undici/actions/runs/4477206842/jobs/7888223614#step:14:7115
climba03003 commentedon Mar 26, 2023
Related to nodejs/node#46528
Seems like either side turns out provide or parsing the header wrongly.
mcollina commentedon Mar 26, 2023
cc @marco-ippolito
marco-ippolito commentedon Mar 27, 2023
With nodejs/node#46528 if there is explicit
content-lenght, thecontent-dispositionheader is encoded in latin1 as per https://www.rfc-editor.org/rfc/rfc6266#section-4.3.Probably there is a mismatch in the implementation, I'll have a look
marco-ippolito commentedon Mar 27, 2023
I dont think this was ever supposed to work:
undici/test/issue-1903.js
Lines 26 to 30 in f0271d4
nodejs/node#46528 this PR solved the behaviour mismatch in encoding when using content length.
@ShogunPanda
KhafraDev commentedon Mar 29, 2023
Even once the header is encoded it still fails. I noticed that undici always encodes the content-disposition header to latin1, even if there is no content-length header too, but fixing that still doesn't pass the test either☹️ .
KhafraDev commentedon Apr 8, 2023
I'm mostly sure this is a bug in node.
The test is triggering this condition and throwing an error:
https://github.com/nodejs/node/blob/57caf1356229bd24c6129574863fa414ff6862b2/lib/_http_outgoing.js#L627
where
valueis a Buffer:so the regex is being called with a buffer, stringifying it to utf8 (as is the default encoding)
if I'm missing something please feel free to correct me 😄
adding on, it makes sense for the value to be a buffer because of the line here
https://github.com/nodejs/node/pull/46528/files#diff-48d21edbddb6e855d1ee5716c49bcdc0d913c11ee8a24a98ea7dbc60cd253556R583
ronag commentedon Apr 8, 2023
Yea I also think this is a Node bug.
Should work and has nothing to do with undici
mcollina commentedon Apr 8, 2023
@marco-ippolito wdyt?
ronag commentedon Apr 8, 2023
I suggest, to get our tests working we disable this test for node 19+ until it's been fixed in Node. @mcollina wdyt?
KhafraDev commentedon Apr 8, 2023
I have a PR that disables it & matches the parsing of content-disposition with node
marco-ippolito commentedon Apr 8, 2023
yes this is a bug,
åshould be a valid character