Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> What's way worse than this is using non-HTML extensions for emitting html. I go to pichost.com/image.jpg and I get a webpage served. This is a bad pattern and it needs to go away. I'm not even going into responding differently depending on user-agent or referrer, if you have combination of these you get JPG returned, if you don't you get a webpage returned.

It's mostly based on the Accept header these days (browsers don't tend to include HTML there in image contexts) and the Referer should have been removed decades ago. This means browsers (the ones with a large market share at least) are 100% complicit in enabling this behavior.



The HTTP standard specifies this behaviour.

HTTP has no concept of a file extension.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: