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

Image served without a content-type header is breaking github's cache #77

Open
MikeRalphson opened this issue Mar 7, 2016 · 6 comments

Comments

@MikeRalphson
Copy link

You can see the effect of this in the project's own README.

See https://help.github.com/articles/why-do-my-images-have-strange-urls/ for further information.

@webron
Copy link
Contributor

webron commented Mar 7, 2016

Can you provide more context please?

@MikeRalphson
Copy link
Author

Sorry. The online swagger validator-badge at swagger.io is serving PNG images with no content-type header:

curl -i http://online.swagger.io/validator?url=https%3A%2F%2Fraw.luolix.top/Mermade/bbcparse/master/nitroApi/swagger.json
HTTP/1.1 200 OK
Date: Mon, 07 Mar 2016 17:37:57 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, DELETE, PUT
Access-Control-Allow-Headers: Content-Type
Cache-Control: no-cache
Server: Jetty(9.2.9.v20150224)
Transfer-Encoding: chunked

This mean's Github's image cache (camo) is failing to cache the image and is returning a broken image link, as per the link in my initial issue.

You can see the effect of this in the swagger validator github project's README here:
https://github.com/swagger-api/validator-badge/#swagger-validator-badge

and in my wiki sidebar here:
https://github.com/Mermade/bbcparse/wiki

@webron
Copy link
Contributor

webron commented Mar 8, 2016

Got it, thanks for the explanation.

@dgrechka
Copy link

I've created a temporal workaround. Script that proxies requests to http://online.swagger.io/validator/ and adds "Content-Type: image/png" header to the response so that camo proxy passes it

You can use it if you want until this issue is fixed. Just query http://dgrechka.net/swagger_validator_content_type_proxy.php instead of http://online.swagger.io/validator/.

E.g.

http://dgrechka.net/swagger_validator_content_type_proxy.php?url=https://raw.githubusercontent.com/dgrechka/FetchClimateAPI/master/RegularUserAPI.yaml

@MikeRalphson
Copy link
Author

@dgrechka Many thanks, will try it out.

jimmidyson added a commit to syndesisio/syndesis-rest that referenced this issue Dec 12, 2016
Use convenient proxy for Swagger badge to work around swagger-api/validator-badge#77
@MikeRalphson
Copy link
Author

Looks like this was fixed in 689ffa8, though not released yet?

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

No branches or pull requests

3 participants