You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
however the browser then request the image at https://git.s-ol.nu/janko-keystep-rgb/blob/master/doc/wiring.png, where he gets served the HTML page showing the image, instead of the raw image with the correct mime type.
I see two solutions:
Detect this situation when rendering the markup and change the src to point to .../raw/master/doc/wiring.png. This seems to be what github does.
Leave the renderer alone and look at the incoming request, when chromium loads the image it sends an Accept: accept: image/webp,image/apng,image/*,*/*;q=0.8 header that clarifies that it is looking for an image, and even explicitly states that anything else (like text/html) will only partially satisfy (q=0.8). This could be detected and the file server raw in that case.
The text was updated successfully, but these errors were encountered:
I agree that we should fix this and I'm happy with both ways, but strong preference for 1.) because it is much simpler (though maybe not easier to implement)
Happy to open a PR with that change, but I suspect most users would prefer a "smarter" solution that doesn't require they add querystrings to their image links.
On github it is common to include images in the README.md, like so:
https://git.s-ol.nu/janko-keystep-rgb/blob/master/README.md
this currently creates the right markup:
however the browser then request the image at
https://git.s-ol.nu/janko-keystep-rgb/blob/master/doc/wiring.png
, where he gets served the HTML page showing the image, instead of the raw image with the correct mime type.I see two solutions:
src
to point to.../raw/master/doc/wiring.png
. This seems to be what github does.Accept: accept: image/webp,image/apng,image/*,*/*;q=0.8
header that clarifies that it is looking for an image, and even explicitly states that anything else (liketext/html
) will only partially satisfy (q=0.8
). This could be detected and the file server raw in that case.The text was updated successfully, but these errors were encountered: