From: Waldemar Kozaczuk <jwkozac...@gmail.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

Added json -> application/json mapping in mime_types in httpserver module

Added json -> application/json mapping in mime_types.cc in httpserver module to make it return correct application/json response header instead of text/plain. This makes it compliant with Swagger specs of the APIs as well as makes browser-side Javascript to automatically parse responses to JSON.

Fixes #833.

Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com>

Message-Id: <1484633055-9489-1-git-send-email-jwkozac...@gmail.com>

---
diff --git a/modules/httpserver/mime_types.cc b/modules/httpserver/mime_types.cc
--- a/modules/httpserver/mime_types.cc
+++ b/modules/httpserver/mime_types.cc
@@ -30,6 +30,7 @@ struct mapping {
     { "txt",  "text/plain" },
     { "ico",  "image/x-icon" },
     { "bin",  "application/octet-stream" },
+    { "json",  "application/json" },
 };

 std::string extension_to_type(const std::string& extension)

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to