-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
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.createServer(options, app .... DOES NOT WORK #4218
Comments
Hi @cekvenich! I tried to reproduce your code as follows: // content for serve.js
const express = require('express')
const https = require('https')
const http = require('http')
const app = express()
http.createServer(app).listen(80)
https.createServer({maxHeaderSize: 16000 }, app).listen(443, () => {
console.warn("maxHeaderSize:", http.maxHeaderSize)
}) If you execute the file directly like You can skip this limitation using the flag |
@UlisesGascon True you can pass the flag to node CLI. |
Hi @cekvenich sorry you are having trouble. I'm not clear where the bug would be, exactly. Are you saying there is a bug in the Express code or a bug in the Express documentation? Would you also be able to help point out where the bug is / perhaps even make a pull request to help fix? |
@dougwilson I can't make a PR since I see you using Object.create and I don't know how to pass args to node from that. It be nice if the code was updated to ES6 class syntax so we users can help. Either docs should say that you can't set the options or setting the options programmatically is broken - as demonstrated by my code. (not the code that someone cut/pasted from docs). |
Hi @cekvenich it's fine if you cannot make a PR; I'm more asking for at least a high-level description, perhaps some links to the code would help us to even know what The code you provided shows the same behavior even if you remove Express completely, example: var http = require('http')
http.createServer({maxHeaderSize: 16000 }, function () {}).listen(8080)
console.warn(http.maxHeaderSize) So I'm unclear where Express is coming into the equation, as the above runs in Node.js without any dependency on Express, but still prints out the wrong information you're looking for it to print... |
@dougwilson So maybe we need to open a bug with node? |
Right, but even if I change |
@dougwilson sorry I deleted message when I read yours wrong and reposted so messages are out of sync. We may have to open an issue w/ node. That is not the http spec. HTTP specs says querystrings/url can be unlimited length Servers is Go and Java work fine and follow the spec. |
Yea, sounds like you should open an issue with Node.js indeed :) ! |
I opened it w/ node: nodejs/node#32290 |
I wrote a test case and it shows that it does work correctly and that bug has to be someplace on my side. |
http.createServer({maxHeaderSize: 16000 }, appInst).listen(8080) console.warn(http.maxHeaderSize)
outpuuts 8192.
Above should listen and set size as documented, it does not.
I create the app, and then do above to listen.
It does not answer to a request on that port and it does not set the maxHeaderSize.
Issue is referenced:
The text was updated successfully, but these errors were encountered: