secure

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package secure adds headers to protect against xss and reflection attacks and force use of https

Index

Constants

This section is empty.

Variables

View Source
var ContentSecurityPolicy = "frame-ancestors 'self'; style-src 'self'; script-src 'self' www.google-analytics.com"

ContentSecurityPolicy defaults to a strict policy disallowing iframes and scripts from any other origin save self (and Google Analytics for scripts)

Functions

func HSTSMiddleware added in v1.6.7

func HSTSMiddleware(h http.HandlerFunc) http.HandlerFunc

HSTSMiddleware adds only the Strict-Transport-Security with a duration of 2 years

func Middleware

func Middleware(h http.HandlerFunc) http.HandlerFunc

Middleware adds some headers suitable for secure sites

Types

This section is empty.

Jump to

Keyboard shortcuts

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