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

No method defined for RTSP requests #44757

Open
dougwilson opened this issue Sep 23, 2022 · 1 comment
Open

No method defined for RTSP requests #44757

dougwilson opened this issue Sep 23, 2022 · 1 comment
Labels
http Issues or PRs related to the http subsystem.

Comments

@dougwilson
Copy link
Member

dougwilson commented Sep 23, 2022

Version

v18.5.0

Platform

Microsoft Windows NT 10.0.19044.0 x64

Subsystem

http

What steps will reproduce the bug?

const http = require('http')
const net = require('net')

const server = http.createServer((req, res) => {
  res.end(String(req.method))
})

server.listen(0, () => {
  const conn = net.connect(server.address().port, 'localhost')

  conn.on('data', (c) => {
    console.log(c.toString())
  })

  conn.on('close', () => {
    server.close()
  })

  conn.on('connect', () => {
    conn.end('DESCRIBE / RTSP/1.0\r\n\r\n')
  })
})

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

I would expect it to show the RTSP method, as https://nodejs.org/dist/latest-v18.x/docs/api/http.html#messagemethod doesn't seem to say that the method is not defined if it is RTSP instead of HTTP. If that is expected behavior, perhaps just a documentation update is in order.

What do you see instead?

That req.method is undefined

Additional information

Is there any way to tell if an incoming request is RTSP rather than HTTP?

@bnoordhuis bnoordhuis added the http Issues or PRs related to the http subsystem. label Sep 24, 2022
@bnoordhuis
Copy link
Member

llhttp knows RTSP (kind of) but see nodejs/llhttp#103 for why it doesn't work. I don't know if this can be fixed without reintroducing the original issue. Probably best to simply document it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants