redirect - ActiveState ActiveGo 1.8
...

Package redirect

import "github.com/streadway/handy/redirect"
Overview
Index

Overview ▾

Package redirect contains filters to handle HTTP and HTTPS redirects

func HTTPS

func HTTPS(next http.Handler) http.Handler

HTTPS ensures the scheme of incoming requests is https:// either from the http.Request.URL.Scheme or X-Forwarded-Proto header. When the scheme is not https, a redirect with 302 will be made to the same host found in http.Request.Host.