diff options
author | antonydevanchi <[email protected]> | 2020-08-25 23:19:18 +0300 |
---|---|---|
committer | antonydevanchi <[email protected]> | 2020-08-25 23:19:18 +0300 |
commit | 2f1958b98162c4728de90c0bd4ce2b763df9c3c3 (patch) | |
tree | 3d4fb8152995e3265a2a4635149ba9d87583e9f7 | |
parent | cab2b5f909e3322ae7bdbe7ab9a356e80b6ecc2c (diff) |
fix HSTS header
-rw-r--r-- | service/http/service.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/service/http/service.go b/service/http/service.go index b260008c..ba0c4b1c 100644 --- a/service/http/service.go +++ b/service/http/service.go @@ -6,6 +6,13 @@ import ( "crypto/x509" "errors" "fmt" + "io/ioutil" + "net/http" + "net/http/fcgi" + "net/url" + "strings" + "sync" + "github.com/sirupsen/logrus" "github.com/spiral/roadrunner" "github.com/spiral/roadrunner/service/env" @@ -14,12 +21,6 @@ import ( "github.com/spiral/roadrunner/util" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" - "io/ioutil" - "net/http" - "net/http/fcgi" - "net/url" - "strings" - "sync" ) const ( @@ -264,7 +265,7 @@ func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) { } if s.https != nil && r.TLS != nil { - w.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains") + w.Header().Add("Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload") } r = attributes.Init(r) |