12345module juptune.http.v1;
Result readRequestLine(
Http1RequestLine requestLine
);
Reads the entire request line. This will configure the reader to be a request parser for the remainder of this message, until finishMessageis called.
This function must be called when the reader is in the startLinestate.
After this function is called, the reader will be in the maybeEndOfHeadersstate.
If an error occurs, the reader will be in an invalid state and should not be used again.
Anything the underlying I/O functions can throw. See juptune.event.io.IoError.
Http1Error.dataExceedsBufferif the request line is larger than the provided buffer.
Http1Error.badRequestMethodif the request method is missing or invalid.
Http1Error.badRequestPathif the request path is missing or invalid.
Http1Error.badRequestVersionif the request version is missing, invalid, or specifies an unsupported version.
Http1Error.badTransportif it is determined that the transport layer is in a bad state, or if the sender appears to be malicious/poorly coded.
A Resultdescribing if an error ocurred. Any Http1Errorwill contain a valid HTTP error response that can be sent to the client as-is.