Skip to content

Commit

Permalink
feat: expose the Content-Disposition header in CORS (#342)
Browse files Browse the repository at this point in the history
Adds a new CORS header to expose the Content-Disposition header to
client side javascript.

Closes #341
  • Loading branch information
asmahood authored Jan 7, 2025
1 parent 1184cdb commit 7b60f99
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/middleware/cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func CORSMiddleware(ctx *gin.Context) {
ctx.Writer.Header().Set("Access-Control-Allow-Credentials", "true")
ctx.Writer.Header().Set("Access-Control-Allow-Headers", "User-Agent, Keep-Alive, Content-Type, Content-Length, Accept-Encoding, Cache-Control")
ctx.Writer.Header().Set("Access-Control-Allow-Methods", "GET, POST, OPTIONS, DELETE, PUT, PATCH")
ctx.Writer.Header().Set("Access-Control-Expose-Headers", "Content-Disposition")

if ctx.Request.Method == http.MethodOptions {
ctx.AbortWithStatus(204)
Expand Down

0 comments on commit 7b60f99

Please sign in to comment.