From 58ca6bb1e5d1aa8b1fb70a7e1bcad8cea6061198 Mon Sep 17 00:00:00 2001 From: deo002 Date: Wed, 26 Jun 2024 14:13:37 +0530 Subject: [PATCH] fix(content_disposition): Expose header content-disposition to the browser --- pkg/middleware/middleware.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/middleware/middleware.go b/pkg/middleware/middleware.go index a7574e6..5943d58 100644 --- a/pkg/middleware/middleware.go +++ b/pkg/middleware/middleware.go @@ -107,6 +107,7 @@ func CORSMiddleware() gin.HandlerFunc { c.Writer.Header().Set("Access-Control-Allow-Origin", "*") c.Writer.Header().Set("Access-Control-Allow-Credentials", "true") c.Writer.Header().Set("Access-Control-Allow-Headers", "Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, accept, origin, Cache-Control, X-Requested-With") + c.Writer.Header().Set("Access-Control-Expose-Headers", "Content-Disposition") c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT, PATCH, DELETE") if c.Request.Method == "OPTIONS" {