0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-07 20:48:55 +02:00

ircd::http: Strongly type headers view in request/response head structs.

This commit is contained in:
Jason Volk 2023-02-22 19:46:52 -08:00
parent b0ad960bae
commit 7472177a78
2 changed files with 8 additions and 14 deletions

View file

@ -325,8 +325,8 @@ struct ircd::http::request::head
string_view forwarded_for;
size_t content_length {0};
string_view uri; // full view of (path, query, fragmet)
string_view headers; // full view of all headers
string_view uri; // full view of (path, query, fragmet)
http::headers headers; // full view of all headers
// full view of all head (request line and headers)
operator string_view() const;
@ -367,7 +367,7 @@ struct ircd::http::response::head
string_view server;
string_view location;
string_view headers;
http::headers headers;
head(parse::capstan &pc, const headers::closure &c);
head(parse::capstan &pc);

View file

@ -519,12 +519,9 @@ try
:line::response{pc}
,headers
{
http::headers
pc, [this](const auto &header)
{
pc, [this](const auto &header)
{
assign(*this, header);
}
assign(*this, header);
}
}
{
@ -540,13 +537,10 @@ try
:line::response{pc}
,headers
{
http::headers
pc, [this, &closure](const auto &header)
{
pc, [this, &closure](const auto &header)
{
assign(*this, header);
closure(header);
}
assign(*this, header);
closure(header);
}
}
{