LibHTTP: Return a StringView from HTTP::normalize_header_value
This lets callers that do not need a string avoid a needless allocation. All callers that do need a string will already either: * Turn it into a ByteString themselves * Pass this along to the isomorphic encoder
This commit is contained in:
parent
5fe1a70c8e
commit
0652a33043
2 changed files with 2 additions and 2 deletions
|
|
@ -79,7 +79,7 @@ bool is_header_value(StringView header_value)
|
|||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-header-value-normalize
|
||||
ByteString normalize_header_value(StringView potential_value)
|
||||
StringView normalize_header_value(StringView potential_value)
|
||||
{
|
||||
// To normalize a byte sequence potentialValue, remove any leading and trailing HTTP whitespace bytes from
|
||||
// potentialValue.
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ struct Header {
|
|||
|
||||
[[nodiscard]] bool is_header_name(StringView);
|
||||
[[nodiscard]] bool is_header_value(StringView);
|
||||
[[nodiscard]] ByteString normalize_header_value(StringView);
|
||||
[[nodiscard]] StringView normalize_header_value(StringView);
|
||||
|
||||
[[nodiscard]] bool is_forbidden_request_header(Header const&);
|
||||
[[nodiscard]] bool is_forbidden_response_header_name(StringView);
|
||||
|
|
|
|||
Loading…
Reference in a new issue