Closed
nodejs/llhttp
#157Labels
httpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.
Description
Version
14.9.2
Platform
all
Subsystem
http
What steps will reproduce the bug?
http accepts any http version and treats it as http1, and passes it along (>= 0 and <= 9.9 in my tests). this may be a feature, but if so could use some documentation since it's a little unexpected maybe.
copying comment from here:
'use strict'
const http = require('http')
const host = 'localhost'
const port = 3000
const handlerequest = function (req, res) {
console.log(req)
console.log(req.httpVersion)
res.writeHead(200)
res.end(`Your Request HTTP Version is ${req.httpVersion}
with Major ${req.httpVersionMajor} and Minor ${req.httpVersionMinor}`)
}
const server = http.createServer(handlerequest)
server.listen(port, host, () => {
console.log(`Server is running on http://${host}:${port}`)
})with:
telnet 127.0.0.1 3000
GET / HTTP/5.6
and the response is
HTTP/1.1 200 OK
Date: Sun, 15 May 2022 15:17:11 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked
46
Your Request HTTP Version is 5.6
with Major 5 and Minor 6
0
How often does it reproduce? Is there a required condition?
no special requirements/conditions
What is the expected behavior?
request being rejected. http 505 maybe? requesting with GET / NOTHTTP/1.1 gives 400 bad request.
What do you see instead?
the node server treats all requests regardless of version as http1
Additional information
No response
Reacted by Matteo Collina
Reacted by Ahmed Elmaghallawy
Metadata
Metadata
Assignees
Labels
httpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.
Activity
tniessen commentedon May 15, 2022
cc @mcollina @nodejs/http
mscdex commentedon May 15, 2022
I think this would need to be lodged in the llhttp repository.
ShogunPanda commentedon May 27, 2022
@mscdex I agree, this is on llhttp. Patch will come soon and then later we can update this.
deps: upgrade llhttp to 6.0.9
deps: upgrade llhttp to 6.0.9
deps: upgrade llhttp to 6.0.9