GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — http: handle multi-value content-disposition header correctly by ArsalanDotMe · Pull Request #50977 · nodejs/node

Conversation

@ArsalanDotMe

@ArsalanDotMe ArsalanDotMe commented Nov 30, 2023

Copy link
Copy Markdown
Contributor

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_RESPONSE error.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

marco-ippolito and bricss reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@nodejs-github-bot

nodejs-github-bot commented Nov 30, 2023

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added http Issues and PRs related to the http subsystem. needs-ci PRs that need a full CI run. labels Nov 30, 2023
@ArsalanDotMe ArsalanDotMe changed the title Handle multi-value content-disposition header correctly http: handle multi-value content-disposition header correctly Nov 30, 2023
@ArsalanDotMe

ArsalanDotMe commented Nov 30, 2023

Copy link
Copy Markdown
Contributor Author

Fixes #50978

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ArsalanDotMe

ArsalanDotMe commented Dec 1, 2023

Copy link
Copy Markdown
Contributor Author

@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 response.setHeader. Everything else works fine that way but content-disposition fails in an unexpected manner.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ArsalanDotMe ArsalanDotMe mentioned this pull request Dec 1, 2023
http: unify header treatment #46528
Merged
@marco-ippolito

marco-ippolito commented Dec 1, 2023

Copy link
Copy Markdown
Member

@ArsalanDotMe can you amend commit message, the ci is failing

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ArsalanDotMe
http: handle multi-value content-disposition header
5e6d348
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

ArsalanDotMe commented Dec 1, 2023

Copy link
Copy Markdown
Contributor Author

yes, sure. just a sec

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ShogunPanda
ShogunPanda approved these changes Dec 6, 2023
View reviewed changes

@ShogunPanda ShogunPanda left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@marco-ippolito marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 6, 2023
marco-ippolito
marco-ippolito approved these changes Dec 6, 2023
View reviewed changes
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 6, 2023
@nodejs-github-bot

nodejs-github-bot commented Dec 6, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/56132/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Dec 6, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/56134/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Dec 9, 2023
View reviewed changes
@nodejs-github-bot

nodejs-github-bot commented Dec 10, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/56197/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Dec 10, 2023
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

nodejs-github-bot commented Dec 10, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/56203/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Dec 11, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/56215/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina mcollina added author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. and removed needs-ci PRs that need a full CI run. labels Dec 11, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Dec 11, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 6e90fed into nodejs:main Dec 11, 2023
@nodejs-github-bot

nodejs-github-bot commented Dec 11, 2023

Copy link
Copy Markdown
Collaborator

Landed in 6e90fed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@steelbrain steelbrain mentioned this pull request Dec 12, 2023
content-disposition request header is incorrectly handled in nodejs 19.9.0 node-fetch/node-fetch#1734
Open
RafaelGSS pushed a commit that referenced this pull request Dec 15, 2023
@ArsalanDotMe @RafaelGSS
http: handle multi-value content-disposition header
7f95926
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 <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Dec 15, 2023
v21.5.0 proposal #51166
Merged
richardlau pushed a commit that referenced this pull request Mar 25, 2024
@ArsalanDotMe @richardlau
http: handle multi-value content-disposition header
4e38dee
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 <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@richardlau richardlau mentioned this pull request Mar 25, 2024
v20.12.0 proposal #52212
Merged
@geirbak

geirbak commented Jun 13, 2024

Copy link
Copy Markdown

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 and ppasieka reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@richardlau richardlau added the lts-watch-v18.x label Jun 13, 2024
@einarq

einarq commented Jun 19, 2024

Copy link
Copy Markdown

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).

@richardlau
Planning on merging this for 18 as well?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@richardlau

richardlau commented Jun 19, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@einarq

einarq commented Jun 19, 2024

Copy link
Copy Markdown

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.

Ok, thanks. We will have to ask people to downgrade to 18.5 in the meantime.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

richardlau pushed a commit that referenced this pull request Jul 19, 2024
@ArsalanDotMe @richardlau
http: handle multi-value content-disposition header
0092358
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 <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@richardlau richardlau added backported-to-v18.x and removed lts-watch-v18.x labels Jul 19, 2024
@geirbak geirbak mentioned this pull request Jul 29, 2024
Node.js Release WorkGroup Meeting 2024-07-25 nodejs/Release#1026
Closed
@aduh95 aduh95 mentioned this pull request Nov 7, 2024
2024-11-12, Version 18.20.5 'Hydrogen' (LTS) #55768
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes
@ShogunPanda ShogunPanda ShogunPanda approved these changes
@jasnell jasnell jasnell approved these changes
@marco-ippolito marco-ippolito marco-ippolito approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. http Issues and PRs related to the http subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@ArsalanDotMe @nodejs-github-bot @marco-ippolito @geirbak @einarq @richardlau @mcollina @ShogunPanda @jasnell
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.