Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return correct content-types for swagger-ui files #17

Closed
wants to merge 1 commit into from

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