فهرست منبع

Correct the timestamp format for Expires response header

jinmiaoluo 2 سال پیش
والد
کامیت
fd69012357
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      internal/http/response/builder.go

+ 1 - 1
internal/http/response/builder.go

@@ -60,7 +60,7 @@ func (b *Builder) WithoutCompression() *Builder {
 func (b *Builder) WithCaching(etag string, duration time.Duration, callback func(*Builder)) {
 	b.headers["ETag"] = etag
 	b.headers["Cache-Control"] = "public"
-	b.headers["Expires"] = time.Now().Add(duration).Format(time.RFC1123)
+	b.headers["Expires"] = time.Now().Add(duration).UTC().Format(http.TimeFormat)
 
 	if etag == b.r.Header.Get("If-None-Match") {
 		b.statusCode = http.StatusNotModified