Uh oh!
There was an error while loading. Please reload this page.
http: handle multi-value content-disposition header correctly - #50977
Conversation
nodejs-github-bot
commented
Nov 30, 2023
Review requested:
|
ArsalanDotMe
commented
Nov 30, 2023
Fixes #50978 |
ArsalanDotMe
commented
Dec 1, 2023
@ShogunPanda@mcollina tagging you to get your eyes on this since you reviewed the related PR before. This change is important because in some libraries, headers are always passed as arrays (usually single value) to |
marco-ippolito
commented
Dec 1, 2023
@ArsalanDotMe can you amend commit message, the ci is failing |
Headers in nodejs can be arrays and current workaround for content-disposition header do not take this into account. This change fixes that and makes sure array values are handled properly.
ArsalanDotMe
commented
Dec 1, 2023
yes, sure. just a sec |
nodejs-github-bot
commented
Dec 6, 2023
nodejs-github-bot
commented
Dec 6, 2023
nodejs-github-bot
commented
Dec 10, 2023
nodejs-github-bot
commented
Dec 10, 2023
nodejs-github-bot
commented
Dec 11, 2023
nodejs-github-bot
commented
Dec 11, 2023
Landed in 6e90fed |
Headers in nodejs can be arrays and current workaround for content-disposition header do not take this into account. This change fixes that and makes sure array values are handled properly. PR-URL: #50977 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Headers in nodejs can be arrays and current workaround for content-disposition header do not take this into account. This change fixes that and makes sure array values are handled properly. PR-URL: #50977 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
geirbak
commented
Jun 13, 2024
I'm not sure where/how is the correct way for me to raise this, but we need this fixed in the 18 LTS (It was introduced in 18.16.0 - #46528). |
einarq
commented
Jun 19, 2024
@richardlau |
I've added the lts-watch-v18.x label to this which will put it on the list of things to consider for the next non-security Node.js 18.x release. |
einarq
commented
Jun 19, 2024
Ok, thanks. We will have to ask people to downgrade to 18.5 in the meantime. |
Headers in nodejs can be arrays and current workaround for content-disposition header do not take this into account. This change fixes that and makes sure array values are handled properly. PR-URL: #50977 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This change fixes a bug introduced by an earlier PR #46528. Basically, in the earlier PR the code was written with the assumption that content-disposition header will always have a scalar string value but in fact Node.js allows users to provide an array as a value for a header.
If you provide an array value for content-disposition header, then the Buffer string would contain characters that are invalid for headers and that results in a
ERR_INVALID_HTTP_RESPONSEerror.