Skip to content

No method defined for RTSP requests #44757

Description

@dougwilson

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues and PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions