We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98d3c60 commit 3beb18fCopy full SHA for 3beb18f
src/serverHandler/hsts.go
@@ -6,16 +6,8 @@ import (
6
)
7
8
func (h *aliasHandler) tryHsts(w http.ResponseWriter, r *http.Request) (needRedirect bool) {
9
- _, port := util.ExtractHostnamePort(r.Host)
10
-
11
- if len(port) > 0 {
12
- return
13
- }
14
15
- header := w.Header()
16
- header.Set("Strict-Transport-Security", "max-age="+h.hstsMaxAge)
17
18
if r.TLS != nil {
+ w.Header().Set("Strict-Transport-Security", "max-age="+h.hstsMaxAge)
19
return
20
}
21
0 commit comments