Skip to content

Conversation

bihe
Copy link

@bihe bihe commented Jul 28, 2019

I was using the "Secure middleware" from echo together with echo-swagger. The result was a blank screen.
The option X-Content-Type-Options: nosniff complained, that the *.js files did not have the correct Content-Type. Which is true as seen in the screenshot:

image

they were delivered using Content-Type: text/plain; charset=utf-8

image

I poked around and found that the gin-swagger implementation takes care of this (https://github.com/swaggo/gin-swagger/blob/master/swagger.go)

My PR just copies the logic of gin-swagger resulting in correct Content-Types which work with "nosniff"

image

@ubogdan
Copy link
Contributor

ubogdan commented Oct 12, 2021

closing: solved in #57

@ubogdan ubogdan closed this Oct 12, 2021
@ubogdan ubogdan mentioned this pull request Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants