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 — feat: check maxHeadersSize on client instantiation and not on Parser instantion by Uzlopak · Pull Request #3654 · nodejs/undici

Conversation

@Uzlopak

@Uzlopak Uzlopak commented Sep 30, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

I guess this would fix 3652 . I am less inclined to download NW.js and figure out how it works. Imho validation of maxHeadersSize should not be done in Parser construction but in the client instantiation.

Sorry, something went wrong.

Uh oh!

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

All reactions
@Uzlopak
fix: check maxHeadersSize on client instantiation and not on Parser i…
9fce688
…nstantion
metcoder95
metcoder95 reviewed Oct 1, 2024
View reviewed changes

@metcoder95 metcoder95 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.

Adding the extra step of validation on dispatcher/client lgmt, but I believe the issue will prevail.

The problem roots to the defaults. If no maxHeaderSize passed and if the runtime doesn't populate [(node:http).maxHeaderSize](https://nodejs.org/api/http.html#httpmaxheadersize), there won't be value to check against it.

I believe the check on client-h1 aimed to avoid that exact scenario.

Sorry, something went wrong.

Uh oh!

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

All reactions
@Uzlopak

Uzlopak commented Oct 1, 2024

Copy link
Copy Markdown
Contributor Author

Yeah, I guess we can consider this an improvement and not a fix. Unfortunately i can somehow not remove the link to that issue. If you approve I would merge it and then reopen the linked issue.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Uzlopak Uzlopak changed the title fix: check maxHeadersSize on client instantiation and not on Parser instantion feat: check maxHeadersSize on client instantiation and not on Parser instantion Oct 1, 2024
metcoder95
metcoder95 reviewed Oct 2, 2024
View reviewed changes
Comment thread lib/dispatcher/client-h1.js Resolved

Uh oh!

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

Uzlopak added 2 commits October 3, 2024 15:16
@Uzlopak
ensure that http.maxHeadersize is valid
998f885
@Uzlopak
fail early, fail fast
6b30664
@Uzlopak

Uzlopak commented Oct 3, 2024

Copy link
Copy Markdown
Contributor Author

@metcoder95

I still think that we dont need that check in the parser. Also why should the parser check if the attribute on the client is valid? Actually hints it to be a validation, that has to happen in the Client API. But you are right, we need to be stricter.

PTAL

metcoder95 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@Uzlopak

Uzlopak commented Oct 3, 2024

Copy link
Copy Markdown
Contributor Author

Or wait... hmm, wont it mean, that you can set maxHeaderSize to 0 meaning any header size?

All reactions

Sorry, something went wrong.

Uh oh!

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

@metcoder95
Merge branch 'main' into fix-3653
299f59c
metcoder95
metcoder95 approved these changes Oct 4, 2024
View reviewed changes

@metcoder95 metcoder95 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,

I was mostly meaning the way we get the default max header size; which you already addressed within the lib/dispatcher/client

Sorry, something went wrong.

Uh oh!

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

All reactions
@metcoder95

metcoder95 commented Oct 4, 2024

Copy link
Copy Markdown
Member

Just tests seems not happy

All reactions

Sorry, something went wrong.

Uh oh!

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

@Uzlopak
fix
d2a1290
@Uzlopak

Uzlopak commented Oct 5, 2024

Copy link
Copy Markdown
Contributor Author

@metcoder95

Tests should now be happy. :D

Also I think that the check in parser is not necessary anymore, because it is handled properly in client already.

metcoder95 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

metcoder95
metcoder95 approved these changes Oct 6, 2024
View reviewed changes

@metcoder95 metcoder95 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
@Uzlopak
Uzlopak merged commit 01abc4f into main Oct 6, 2024
@Uzlopak
Uzlopak deleted the fix-3653 branch October 6, 2024 13:20
flakey5 pushed a commit to flakey5/undici that referenced this pull request Oct 8, 2024
@Uzlopak @metcoder95 @flakey5
feat: check maxHeadersSize on client instantiation and not on Parser …
2679c40
…instantion (nodejs#3654)

* fix: check maxHeadersSize on client instantiation and not on Parser instantion

* ensure that http.maxHeadersize is valid

* fail early, fail fast

* fix

---------

Co-authored-by: Carlos Fuentes <[email protected]>
@Uzlopak Uzlopak added the backport v6.x label Oct 12, 2024
@github-actions

github-actions Bot commented Oct 12, 2024

Copy link
Copy Markdown
Contributor

The backport to v6.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-v6.x v6.x
# Navigate to the new working tree
cd .worktrees/backport-v6.x
# Create a new branch
git switch --create backport-3654-to-v6.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 01abc4fc601edba0f5ec7d2cb2388e50e006d3cd
# Push it to GitHub
git push --set-upstream origin backport-3654-to-v6.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-v6.x

Then, create a pull request where the base branch is v6.x and the compare/head branch is backport-3654-to-v6.x.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot mentioned this pull request Dec 3, 2024
[Release] v7.1.0 #3922
Merged
This was referenced Dec 16, 2024
[Release] v7.1.1 #3952
Closed
[Release] v7.2.0 #3962
Merged
@github-actions github-actions Bot mentioned this pull request Mar 12, 2025
[Release] v6.21.2 #4092
Closed
@github-actions github-actions Bot mentioned this pull request May 12, 2025
[Release] v6.21.3 #4211
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@metcoder95 metcoder95 metcoder95 approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

backport v6.x

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.

2 participants

@Uzlopak @metcoder95
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 01402775 — 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.