From 8be9e0946fabfddf6dbcd7fb11ac8beefacaabe5 Mon Sep 17 00:00:00 2001 From: Anurag Kar Date: Mon, 8 Oct 2018 16:12:19 +0530 Subject: [PATCH] HTTP Server : Default content type of response should be HTTPD_TYPE_TEXT Closes https://github.com/espressif/esp-idf/issues/2527 --- components/http_server/src/httpd_parse.c | 2 +- examples/protocols/http_server/advanced_tests/scripts/test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/http_server/src/httpd_parse.c b/components/http_server/src/httpd_parse.c index c8dfe69f6..64629f518 100644 --- a/components/http_server/src/httpd_parse.c +++ b/components/http_server/src/httpd_parse.c @@ -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; diff --git a/examples/protocols/http_server/advanced_tests/scripts/test.py b/examples/protocols/http_server/advanced_tests/scripts/test.py index 683b62b17..f1fcedaec 100644 --- a/examples/protocols/http_server/advanced_tests/scripts/test.py +++ b/examples/protocols/http_server/advanced_tests/scripts/test.py @@ -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")