Misdirected Request
Production Risk
Low. This is a specific protocol error for HTTP/2. A compliant HTTP/2 client should handle this by not reusing the connection for the misdirected request.
The request was directed at a server that is not able to produce a response. This can be sent by a server that is not configured to produce responses for the combination of scheme and authority that are included in the request URI.
- 1A client reuses an HTTP/2 connection for a different domain (e.g., example.com) that is hosted on the same server but not configured to be served over that connection.
- 2A server's TLS certificate is valid for www.example.com but not for api.example.com, and a client tries to access both over the same connection.
A client has an open HTTP/2 connection to a server for 'site-a.com' and tries to reuse it for a request to 'site-b.com', which resolves to the same IP but is not part of the server's configuration for that connection.
(Within an HTTP/2 connection established for one domain, a request is made for another)
expected output
HTTP/1.1 421 Misdirected Request
Fix
Open a New Connection
WHEN Requesting a resource from a different origin.
The client should establish a new, separate connection for the new domain.
Why this works
Client-Side Logic
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev