guss v0.1.1 Guss.Canonical.Extensions View Source
Generates iodata for Canonicalized Extension Headers
Extension headers are generated using the following algorithm:
- Make all custom header names lowercase.
- Sort all custom headers by header name using a lexicographical sort by code point value.
- If present, remove the
x-goog-encryption-key
andx-goog-encryption-key-sha256
headers. These headers contain sensitive information that must not be included in the string-to-sign; however, these headers must still be used in any requests that use the generated signed URL. - Eliminate duplicate header names by creating one header name with a comma-separated list of values. Be sure there is no whitespace between the values, and be sure that the order of the comma-separated list matches the order that the headers appear in your request. For more information, see RFC 7230 section 3.2.
- Replace any folding whitespace or newlines (CRLF or LF) with a single space. For more information about folding whitespace, see RFC 7230, section 3.2.4.
- Remove any whitespace around the colon that appears after the header name.
- Append a newline
\n
(U+000A) to each custom header. - Concatenate all custom headers.
Link to this section Summary
Functions
Converts resource extensions into canonical extension headers
Link to this section Functions
Converts resource extensions into canonical extension headers.
Examples
iex> to_string(Guss.Canonical.Extensions.to_iodata(acl: :public_read, meta: [project: [name: "guss"]]))
"x-goog-acl:public-read\nx-goog-meta-project-name:guss\n"