From 2f1958b98162c4728de90c0bd4ce2b763df9c3c3 Mon Sep 17 00:00:00 2001 From: antonydevanchi Date: Tue, 25 Aug 2020 23:19:18 +0300 Subject: fix HSTS header --- service/http/service.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'service') 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) -- cgit v1.2.3