实现HTTPS配置

This commit is contained in:
刘祥超
2020-10-01 16:00:52 +08:00
parent 83df1be84d
commit 14215d9a03
4 changed files with 27 additions and 28 deletions

View File

@@ -948,12 +948,12 @@ func (this *HTTPRequest) processResponseHeaders(statusCode int) {
// HSTS
if this.IsHTTPS &&
this.Server.HTTPS != nil &&
this.Server.HTTPS.SSL != nil &&
this.Server.HTTPS.SSL.IsOn &&
this.Server.HTTPS.SSL.HSTS != nil &&
this.Server.HTTPS.SSL.HSTS.IsOn &&
this.Server.HTTPS.SSL.HSTS.Match(this.Host) {
responseHeader.Set(this.Server.HTTPS.SSL.HSTS.HeaderKey(), this.Server.HTTPS.SSL.HSTS.HeaderValue())
this.Server.HTTPS.SSLPolicy != nil &&
this.Server.HTTPS.SSLPolicy.IsOn &&
this.Server.HTTPS.SSLPolicy.HSTS != nil &&
this.Server.HTTPS.SSLPolicy.HSTS.IsOn &&
this.Server.HTTPS.SSLPolicy.HSTS.Match(this.Host) {
responseHeader.Set(this.Server.HTTPS.SSLPolicy.HSTS.HeaderKey(), this.Server.HTTPS.SSLPolicy.HSTS.HeaderValue())
}
}