-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Silent disconnect on very long request URLs #1368
Copy link
Copy link
Closed
Labels
A-serverArea: server.Area: server.C-bugCategory: bug. Something is wrong. This is bad!Category: bug. Something is wrong. This is bad!E-mediumEffort: medium. Some knowledge of how hyper internal works would be useful.Effort: medium. Some knowledge of how hyper internal works would be useful.
Description
As iron/iron#563 mentioned, hyper close connection silently on very long request URLs.
The slice of the log shown bellow:
TRACE:hyper::proto::conn : Conn::read_head
TRACE:hyper::proto::h1::parse : Request.parse([Header; 100], [u8; 8192])
TRACE:hyper::proto::h1::parse : Request.parse([Header; 100], [u8; 16384])
TRACE:hyper::proto::h1::parse : Request.parse([Header; 100], [u8; 32768])
TRACE:hyper::proto::h1::parse : Request.parse([Header; 100], [u8; 65536])
TRACE:hyper::proto::h1::parse : Request.parse([Header; 100], [u8; 131072])
TRACE:hyper::proto::h1::parse : Request.parse([Header; 100], [u8; 262144])
TRACE:hyper::proto::h1::parse : Request.parse([Header; 100], [u8; 524288])
==> DEBUG:hyper::proto::io : MAX_BUFFER_SIZE reached, closing
==> TRACE:hyper::proto::conn : State::close_read()
==> DEBUG:hyper::proto::conn : parse error (Message head is too large) with 524288 bytes
I think hyper should define the MAX_URI_LENGTH, or make it configurable. When the length of a request's URI exceed that value, hyper send a response with 414 (Request URI too long) status code to client instead of closing the connection silently.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-serverArea: server.Area: server.C-bugCategory: bug. Something is wrong. This is bad!Category: bug. Something is wrong. This is bad!E-mediumEffort: medium. Some knowledge of how hyper internal works would be useful.Effort: medium. Some knowledge of how hyper internal works would be useful.