3 ms·
I wanted to test if an old school META "http-equiv" directive would be a temporary fix for this issue.. so I tried to recreate the problem by making a one-shot
by petercooper 8y ago
I wanted to test if an old school META "http-equiv" directive would be a temporary fix for this issue.. so I tried to recreate the problem by making a one-shot HTTP server with netcat that only returned Content-Length and no Content-Type header:
{ printf 'HTTP/1.1 200 OK\r\nContent-Length: %d\r\n\r\n' "$(wc -c < a.html)"; cat a.html; } | nc -l 8080
Yet Chrome, Firefox and Safari automatically detect the payload is HTML and renders it properly without any Content-Type header, unlike with her pages. What am I missing?
- treve 8y agoPerhaps a X-Content-Type-Options: nosniff header?
- petercooper 8y agoAha, that was indeed the one - thanks :) And.. I can confirm meta http-equiv does not help in this scenario at all.