aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--amalgamate/crow_all.h5
-rw-r--r--include/http_response.h5
2 files changed, 8 insertions, 2 deletions
diff --git a/amalgamate/crow_all.h b/amalgamate/crow_all.h
index d9f5624..30129f7 100644
--- a/amalgamate/crow_all.h
+++ b/amalgamate/crow_all.h
@@ -5967,8 +5967,11 @@ namespace crow
explicit response(int code) : code(code) {}
response(std::string body) : body(std::move(body)) {}
response(json::wvalue&& json_value) : json_value(std::move(json_value)) {}
- response(const json::wvalue& json_value) : body(json::dump(json_value)) {}
response(int code, std::string body) : body(std::move(body)), code(code) {}
+ response(const json::wvalue& json_value) : body(json::dump(json_value))
+ {
+ set_header("Content-Type", "application/json");
+ }
response(response&& r)
{
diff --git a/include/http_response.h b/include/http_response.h
index 7288cc3..807e6ac 100644
--- a/include/http_response.h
+++ b/include/http_response.h
@@ -41,8 +41,11 @@ namespace crow
explicit response(int code) : code(code) {}
response(std::string body) : body(std::move(body)) {}
response(json::wvalue&& json_value) : json_value(std::move(json_value)) {}
- response(const json::wvalue& json_value) : body(json::dump(json_value)) {}
response(int code, std::string body) : body(std::move(body)), code(code) {}
+ response(const json::wvalue& json_value) : body(json::dump(json_value))
+ {
+ set_header("Content-Type", "application/json");
+ }
response(response&& r)
{