Request Line
The request-line is the first line of an HTTP request: method SP request-target SP HTTP-version CRLF. RFC 9112 Section 3 defines its grammar strictly. Malformed request-lines are a common vector for parser confusion.
The Rule
"Recipients of an invalid request-line SHOULD respond with either a 400 (Bad Request) error or a 301 (Moved Permanently) redirect with the request-target properly encoded." — RFC 9112 Section 3
Note this is a SHOULD, not a MUST. The RFC recommends 400 but does not mandate it — closing the connection is also acceptable.
Tests
MULTI-SP-REQUEST-LINE
Multiple spaces between method, target, and version.
MISSING-TARGET
Request-line with no request-target.
FRAGMENT-IN-TARGET
Fragment identifier (#) in request-target.
INVALID-VERSION
Unrecognized HTTP version string.
HTTP09-REQUEST
HTTP/0.9 style request with no version.
ASTERISK-WITH-GET
Asterisk-form (*) with non-OPTIONS method.
OPTIONS-STAR
OPTIONS * — valid asterisk-form request.
UNKNOWN-TE-501
Unknown Transfer-Encoding without CL.
METHOD-CONNECT
CONNECT to an origin server must be rejected.
HEAD-NO-BODY
HEAD response must not contain a message body.
UNKNOWN-METHOD
Unrecognized method should be rejected with 501 or 405.
405-ALLOW
405 response must include an Allow header.
OPTIONS-ALLOW
OPTIONS response should include Allow header.
Unscored
Http11Probe — HTTP/1.1 compliance & smuggling testerSource on GitHub