commonproc

package
v0.0.0-...-66d415d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

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

View Source
var ApplySameOriginPolicy processor.Processor = &applySameOriginPolicy{}

ApplySameOriginPolicy erases the preload links that may load cross-doamin resources.

View Source
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.

View Source
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.

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL