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:
parent
b0ad960bae
commit
7472177a78
|
@ -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);
|
||||
|
|
16
ircd/http.cc
16
ircd/http.cc
|
@ -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);
|
||||
}
|
||||
}
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue