Merge branch 'bugfix/httpd_default_content_type' into 'master'

HTTP Server : Default content type of response should be HTTPD_TYPE_TEXT

See merge request idf/esp-idf!3443
This commit is contained in:
Angus Gratton 2018-10-10 08:21:56 +08:00
commit 7904da0600
2 changed files with 2 additions and 2 deletions

View file

@ -567,7 +567,7 @@ esp_err_t httpd_req_new(struct httpd_data *hd, struct sock_db *sd)
ra->sd = sd;
/* Set defaults */
ra->status = (char *)HTTPD_200;
ra->content_type = (char *)HTTPD_TYPE_JSON;
ra->content_type = (char *)HTTPD_TYPE_TEXT;
ra->first_chunk_sent = false;
/* Copy session info to the request */
r->sess_ctx = sd->ctx;

View file

@ -341,7 +341,7 @@ def get_hello(dut, port):
if not test_val("data", "Hello World!", resp.read().decode()):
conn.close()
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()
return False
Utility.console_log("Success")