Skip to main content

append_header_value

Function append_header_value 

Source
pub fn append_header_value(
    headers: &mut HeaderMap,
    name: HeaderName,
    value: HeaderValue,
) -> bool
Expand description

Append one already validated field value without replacing existing values.

Existing values for name remain in the map and value is appended after them. The return value is true when the map already contained at least one value for name, and false when this call inserted its first value. HeaderName and HeaderValue validate their own inputs before this function is called, so appending is infallible. The helper does not inspect, format, or log the value; callers must continue to treat credential-bearing values as sensitive.