Few days ago my code has been working just fine, but today i am having very strange behavior. I am trying to send base64 data with Content-Type set to image/jpeg but my browser is receiving 2 headers with key Content-Type (image/jpeg and text/html). This is my code to set header:
Code: Select all
httpd_resp_set_hdr(req, "Content-Type", "image/jpeg");
httpd_resp_send(req, (const char*)data->base64_data, data->base64_size);
Browser response headers:
Code: Select all
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 20480
Content-Type: image/jpeg
Just checked and for text/json i am also getting two Content-Type headers:
Code: Select all
Content-Length: 27168
Content-Type: text/html
Content-Type: text/json