From cd466e309d0ecbdd6ce038bb5a93ec4041df405b Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Fri, 2 Jun 2023 15:23:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E5=86=99=E5=85=A5Header?= =?UTF-8?q?=E6=97=B6=E5=BF=BD=E7=95=A5Strict-Transport-Security=E5=92=8CAl?= =?UTF-8?q?t-Svc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_writer.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/internal/nodes/http_writer.go b/internal/nodes/http_writer.go index 3267657..6d77754 100644 --- a/internal/nodes/http_writer.go +++ b/internal/nodes/http_writer.go @@ -362,7 +362,10 @@ func (this *HTTPWriter) PrepareCache(resp *http.Response, size int64) { // 写入Header var headerBuf = utils.SharedBufferPool.Get() for k, v := range this.Header() { - if k == "Set-Cookie" || (this.isPartial && k == "Content-Range") { + if k == "Set-Cookie" || + k == "Strict-Transport-Security" || + k == "Alt-Svc" || + (this.isPartial && k == "Content-Range") { continue } for _, v1 := range v { @@ -690,7 +693,10 @@ func (this *HTTPWriter) PrepareCompression(resp *http.Response, size int64) { // 写入Header var headerBuffer = utils.SharedBufferPool.Get() for k, v := range this.Header() { - if k == "Set-Cookie" || (this.isPartial && k == "Content-Range") { + if k == "Set-Cookie" || + k == "Strict-Transport-Security" || + k == "Alt-Svc" || + (this.isPartial && k == "Content-Range") { continue } for _, v1 := range v { @@ -1018,7 +1024,9 @@ func (this *HTTPWriter) finishWebP() { if webpCacheWriter != nil { // 写入Header for k, v := range this.Header() { - if k == "Set-Cookie" { + if k == "Set-Cookie" || + k == "Strict-Transport-Security" || + k == "Alt-Svc" { continue } @@ -1237,7 +1245,10 @@ func (this *HTTPWriter) finishRequest() { // 计算Header长度 func (this *HTTPWriter) calculateHeaderLength() (result int) { for k, v := range this.Header() { - if k == "Set-Cookie" || (this.isPartial && k == "Content-Range") { + if k == "Set-Cookie" || + k == "Strict-Transport-Security" || + k == "Alt-Svc" || + (this.isPartial && k == "Content-Range") { continue } for _, v1 := range v {