Skip to content

Unexpected behaviour for non-HTTP requests #110

@wichert

Description

@wichert

I just had an application show an unexpected error because request.method was ''. A bit of debugging reveals the culprit to be a non-HTTP request coming in with this first line:

GET /info?txtAirPlay&txtRAOP RTSP/1.0

When waitress receives that request and tries to parse it calls waitress.parse.crack_first_line. That sees the line does not claim to be HTTP and aborts:

>>> from waitress.parser import *
>>> crack_first_line('GET /info?txtAirPlay&txtRAOP RTSP/1.0')
('', '', '')

Waitress does proceed to treat this as a normal HTTP request and sends it down the WSGI stack. I'm not sure what the best behaviour is. I can see a few options:

  1. Keep the current behaviour.
  2. Abort processing for non-HTTP requests
  3. Try to be less strict when parsing the first line and treat this as a GET request, with protocol set to RTSP/1.0 (does the wsgi environ have a protocol field?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions