class Awscr::Signer::HeaderCollection
- Awscr::Signer::HeaderCollection
- Reference
- Object
Overview
An array like structure that holds Header
objects. Duplicated
headers are merged into a single header. The data structure maintains
proper ordering of the headers.
headers = HeaderCollection.new
headers.add(Header.new("k", "v"))
headers.to_a # => [Header.new("k", "v")]
Included Modules
- Enumerable(Awscr::Signer::Header)
Defined in:
awscr-signer/core/header_collection.crConstant Summary
-
BLACKLIST_HEADERS =
["cache-control", "content-length", "expect", "max-forwards", "pragma", "te", "if-match", "if-none-match", "if-modified-since", "if-unmodified-since", "if-range", "accept", "authorization", "proxy-authorization", "from", "referer", "user-agent"]
-
List of headers names not allowed in the collection.
Instance Method Summary
-
#[]=(key, value)
Set or add a header by key value
-
#[]?(key) : Header | Nil
Get a header by key, or nil of it does not exit
-
#add(k : String, v : String) : HeaderCollection
Adds a header to the collection.
-
#add(header : Header) : HeaderCollection
Adds a Header to the internal header list If the header already exists, it's value is updated
-
#delete(header : Header)
Deletes the header
-
#delete(key : String)
Deletes a header by a string
-
#each(&)
Yields each header
-
#keys
Returns a list of the header keys ie: names
-
#to_s(io : IO)
Returns the collection of headers separated by newline with a trailing new line added
Instance Method Detail
Adds a header to the collection. Merging duplicate header keys as per AWS requirements
Adds a Header to the internal header list If the header already exists, it's value is updated
Returns the collection of headers separated by newline with a trailing new line added