I am writing a web server in C #, just for fun, and I can serve basic text files in my browser. However, when servicing an image (for example image.png
), all browsers on which I test my server (IE, Firefox and Chrome) display an image with an image of a place for the image, as if the image was damaged or invalid.
The answer I send to the browser looks like
HTTP/1.0 200 Ok
Content-Type: image/png
Content-Length: 14580053
{image data here}
Am I using the correct HTTP headers? Or, if so, why won't other browsers accept the image?
source
share