Module kvarn::prelude::utils::parse

source ·
Expand description

General parsing complying to the HTTP standards.

This parses small bits of a HTTP request/response to extract common information. The sanitize_request exists to check if a request is valid.

This is where part of Layer 6 resides. The list_header and query are very useful.




  • Formats headers and returns the bytes from the start of bytes where the body starts; how many bytes the header occupy.
  • Parses a header with a value-quality list of pairs.
  • Parses a query to a map between keys and their values, as specified in the query.
  • Sanitizes request for unwanted data and returns critical components.
  • Will convert an str path component of a Uri to a Path. It asserts the first byte is a / and then chops it off.
  • Parses a Version.