swagger-api / validator-badge

Validate your Swagger JSON/YAML today!
http://swagger.io
Apache License 2.0
209 stars 85 forks source link

Validator badges not being rendered on Github #110

Open harrisj opened 7 years ago

harrisj commented 7 years ago

GitHub seems to proxy images and for some reason the badge is not making it through that process correctly. So, you see a broken image on the page and a link going to a URL like https://camo.githubusercontent.com/<long_hash_string> that is 404ing. You can see the failure on your own README. I have tried flipping it to use a https URL instead (since camo is for wrapping insecure image requests), but that doesn't seem to have made a difference. Given that many people put badges on their README.md, this is likely to affect many users. Thanks!

fehguy commented 7 years ago

Unfortunately that's how GitHub is handling dynamic requests. I don't know of a way around it.

harrisj commented 7 years ago

Well, is it possible that we could trick Github by allowing a request to validator.svg (or whatever the type of the image is)?

fehguy commented 7 years ago

I think this is intentional with GH, it's how they avoid people sneaking tracking scripts into pages. I'm not an expert in it, and it changes often but I've seen this happen where you save the page and instead of rendering a dynamic image, they'll make a copy and save it in their CDN.

harrisj commented 7 years ago

Ah well, I've had to remove the badge from our README, but I would like to be able to add it back in the future if this ever gets resolved. Thank you.

cptaffe commented 7 years ago

@fehguy they just cache the image for whatever the Cache-Control is set to

MikeRalphson commented 6 years ago

Possible dupe of #77