@arimelody.me on Bluesky: "web developers are getting too cocky. if visiting your `.png` URI doesn't give me the raw bytes of a png image and nothing else, your balls should explode  if you don't have balls, you grow balls that immediately explode"
you are viewing a single comment's thread
view the rest of the comments
[–] [S] 2 points 1 year ago (3 children)

The HTTP headers can be wrong, the only definitive way to determine a file's content type is to read it. This is why you can stick an image that has a mime type header of application/octet-stream in an img tag and it'll mostly work. Most binary formats will have some kind of magic number at the start to help determine it.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 4 points 1 year ago (2 children)

    Which is bad and wrong. Postel's law has been considered a bad idea by Postel himself for a while. We shouldn't let such fuzziness go through.

  • source
  • parent
  • hideshow 2 child comments
  • [–] [S] 2 points 1 year ago (1 child)

    Meh, you shouldn't need a sophisticated understanding of file formats and web server configuration to make a website, so some slack is imo a good thing. Maybe not as much as there is, but reading the head of an image file doesn't seem that big a deal.

  • source
  • parent
  • hideshow 1 child comment