]> granicus.if.org Git - esp-idf/commitdiff
HTTP Server : Default content type of response should be HTTPD_TYPE_TEXT
authorAnurag Kar <anurag.kar@espressif.com>
Mon, 8 Oct 2018 10:42:19 +0000 (16:12 +0530)
committerAnurag Kar <anurag.kar@espressif.com>
Mon, 8 Oct 2018 12:42:15 +0000 (18:12 +0530)
Closes https://github.com/espressif/esp-idf/issues/2527

components/http_server/src/httpd_parse.c
examples/protocols/http_server/advanced_tests/scripts/test.py

index c8dfe69f6f49b5610f7e2a1e640278d47f678241..64629f51816a7b16385c3dc6d314a4ed53993690 100644 (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;
index 683b62b17724d9a329cb821413a729d48fd36a71..f1fcedaec47722c4989de051f6e1f555a3c61086 100644 (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")