Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http spec says url/query-sting should be unlimited. this can't be set programatically. #32290

Closed
cekvenich opened this issue Mar 15, 2020 · 7 comments
Labels
doc Issues and PRs related to the documentations. good first issue Issues that are suitable for first-time contributors. http Issues or PRs related to the http subsystem.

Comments

@cekvenich
Copy link

var http = require('http')
http.createServer({maxHeaderSize: 16000 }, function () {}).listen(8080)
console.warn(http.maxHeaderSize)

Above does not set the maxHeaderSize. Yes you can do it from CLI, but you should be able to set it programatically.
#24692
expressjs/express#4218

@addaleax
Copy link
Member

console.warn(http.maxHeaderSize)

This does not give you the maximum header size for a specific server, only the global default.

@cekvenich
Copy link
Author

So how do I find what it is set to?

For sure it does not set it because I have a long query string that works when I set it w/ CLI, but does not work when I set it programmatically.

@addaleax addaleax added doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem. good first issue Issues that are suitable for first-time contributors. labels Mar 15, 2020
@addaleax
Copy link
Member

Ah, right, that should have been documented. server.maxHeaderSize gives you the value that it has been set to.

@cekvenich
Copy link
Author

@addaleax How do I get the handle to the server ? I'm using this from express like so:
http.createServer({maxHeaderSize: 16000 }, ExpInst).listen(8080) console.warn(http.maxHeaderSize)

But in any case in my testing, the maxHeaderSize is not set because it 'blocks' a large request

@addaleax
Copy link
Member

addaleax commented Mar 15, 2020

@cekvenich

const server = http.createServer({maxHeaderSize: 16000 }, ExpInst).listen(8080)
console.warn(server.maxHeaderSize)

But in any case in my testing, the maxHeaderSize is not set because it 'blocks' a large request

Okay, but without an example/reproduction and information about your system such as Node.js version, there’s really nothing we can do.

@dormesica
Copy link

dormesica commented Mar 16, 2020

This seems like a good place for getting into the project.
I would like to help with that if that's OK 😁

@cekvenich
Copy link
Author

@addaleax I wrote a test to prove it does not work:
https://github.com/cekvenich/node-http-t/blob/master/index.js
But it proved inadvertently that it does work.
ps: I may remove that test repo I linked here.
So I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. good first issue Issues that are suitable for first-time contributors. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants