validator-badge
validator-badge copied to clipboard
Image served without a content-type header is breaking github's cache
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.
Can you provide more context please?
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.githubusercontent.com/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
Got it, thanks for the explanation.
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
@dgrechka Many thanks, will try it out.
Looks like this was fixed in 689ffa80, though not released yet?