28 const std::vector<std::byte> http_buffer{ConsumeRandomLengthByteVector<std::byte>(
fuzzed_data_provider, 4096)};
30 HTTPRequest http_request;
33 if (!http_request.LoadControlData(
reader))
return;
34 if (!http_request.LoadHeaders(
reader))
return;
35 if (!http_request.LoadBody(
reader))
return;
36 }
catch (
const std::runtime_error&) {
42 (void)http_request.GetURI();
43 (void)http_request.GetHeader(
"Host");
45 (void)http_request.GetHeader(header);
47 (void)http_request.GetHeader(header);
48 const std::string body = http_request.ReadBody();
std::string ConsumeRandomLengthString(size_t max_length)
std::string_view RequestMethodString(HTTPRequestMethod m)
HTTP request method as string - use for logging only.
FUZZ_TARGET(http_request)
constexpr size_t MAX_HEADERS_SIZE
Maximum size of each headers line in an HTTP request, also the maximum size of all headers total.
FuzzedDataProvider & fuzzed_data_provider