Documentation ¶
Overview ¶
Package commonproc implements processors applicable to any HTTP responses. They are typically used either as preprocessors or postprocessors, included in SequencialProcessor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ApplySameOriginPolicy processor.Processor = &applySameOriginPolicy{}
ApplySameOriginPolicy erases the preload links that may load cross-doamin resources.
var ContentTypeProcessor processor.Processor = &contentTypeProcessor{}
ContentTypeProcessor adds the "X-Content-Type-Options: nosniff" header, which prevents the browsers to "auto-correct" the content type. ContentTypeProcessor also adds the Content-Type header when it is absent, emitting a warning log.
var ExtractPreloadHeaders processor.Processor = &extractPreloadHeaders{}
ExtractPreloadHeaders parses the Link HTTP headers of the provided exchange.Response and turns the preload links into preload.Preload objects. The preload links will be added to the Preloads field and removed from the Link HTTP headers. Note they will be eventually added back to the Link HTTP headers when the response is turned into a signed exchange.
var RemoveUncachedHeaders processor.Processor = &removeUncachedHeaders{}
RemoveUncachedHeaders removes uncached header fields. Such header fields are disallowed in signed exchanges. https://tools.ietf.org/html/draft-yasskin-http-origin-signed-responses-07#section-4.1.
Functions ¶
This section is empty.
Types ¶
This section is empty.