OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / kr / secureheader / example_test.go
1 package secureheader_test
2
3 import (
4         "github.com/kr/secureheader"
5         "net/http"
6 )
7
8 func Example() {
9         http.Handle("/", http.FileServer(http.Dir("/tmp")))
10         http.ListenAndServe(":80", secureheader.DefaultConfig)
11 }
12
13 func Example_custom() {
14         http.Handle("/", http.FileServer(http.Dir("/tmp")))
15         secureheader.DefaultConfig.HSTSIncludeSubdomains = false
16         secureheader.DefaultConfig.FrameOptions = false
17         http.ListenAndServe(":80", secureheader.DefaultConfig)
18 }