headers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package headers provides utilities for setting various headers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoNotCache

func DoNotCache(w http.ResponseWriter)

DoNotCache tells the browser to never cache the page being rendered. Performance will take a hit because the server must serve more requests, but sometimes it is vital that the data on a page stays fresh. Examples include the browser almost always displaying a cached result of the page when a user presses the back button, potentially displaying to the user stale data. Using DoNotCache will force the browser to request the server for a new page everytime, without caching it.

TL;DR use this for data-sensitive pages where data changes all the time and it is not acceptable to show outdated information.

func SecurityHeaders

func SecurityHeaders(w http.ResponseWriter)

SecurityHeaders sets headers related to security to every outgoing response. For more information visit https://securityheaders.com.

func SecurityHeadersHandler

func SecurityHeadersHandler(next http.Handler) http.Handler

SecurityHeadersHandler is a http.Handler middleware wrapper around SecurityHeaders.

Types

This section is empty.

Jump to

Keyboard shortcuts

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