mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
HTTP Server : Default content type of response should be HTTPD_TYPE_TEXT
Closes https://github.com/espressif/esp-idf/issues/2527
This commit is contained in:
parent
05c510b44e
commit
8be9e0946f
@ -567,7 +567,7 @@ esp_err_t httpd_req_new(struct httpd_data *hd, struct sock_db *sd)
|
|||||||
ra->sd = sd;
|
ra->sd = sd;
|
||||||
/* Set defaults */
|
/* Set defaults */
|
||||||
ra->status = (char *)HTTPD_200;
|
ra->status = (char *)HTTPD_200;
|
||||||
ra->content_type = (char *)HTTPD_TYPE_JSON;
|
ra->content_type = (char *)HTTPD_TYPE_TEXT;
|
||||||
ra->first_chunk_sent = false;
|
ra->first_chunk_sent = false;
|
||||||
/* Copy session info to the request */
|
/* Copy session info to the request */
|
||||||
r->sess_ctx = sd->ctx;
|
r->sess_ctx = sd->ctx;
|
||||||
|
@ -341,7 +341,7 @@ def get_hello(dut, port):
|
|||||||
if not test_val("data", "Hello World!", resp.read().decode()):
|
if not test_val("data", "Hello World!", resp.read().decode()):
|
||||||
conn.close()
|
conn.close()
|
||||||
return False
|
return False
|
||||||
if not test_val("data", "application/json", resp.getheader('Content-Type')):
|
if not test_val("data", "text/html", resp.getheader('Content-Type')):
|
||||||
conn.close()
|
conn.close()
|
||||||
return False
|
return False
|
||||||
Utility.console_log("Success")
|
Utility.console_log("Success")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user