Skip to content

Instantly share code, notes, and snippets.

@caktux
Last active August 29, 2015 14:03
Show Gist options
  • Save caktux/b876fb0bf638f02387a8 to your computer and use it in GitHub Desktop.
Save caktux/b876fb0bf638f02387a8 to your computer and use it in GitHub Desktop.
diff --git a/src/jsonrpccpp/server/connectors/httpserver.cpp b/src/jsonrpccpp/server/connectors/httpserver.cpp
index 29088b3..b316a3a 100644
--- a/src/jsonrpccpp/server/connectors/httpserver.cpp
+++ b/src/jsonrpccpp/server/connectors/httpserver.cpp
@@ -124,8 +124,10 @@ bool HttpServer::SendResponse(const std::string& response, void* addInfo)
{
struct mg_connection* conn = (struct mg_connection*) addInfo;
if (mg_printf(conn, "HTTP/1.1 200 OK\r\n"
- "Content-Type: application/json\r\n"
+ "Content-Type: application/json; charset=utf-8\r\n"
"Content-Length: %d\r\n"
+ "Access-Control-Allow-Origin: *\r\n"
+ "Access-Control-Allow-Headers: Content-Type\r\n"
"\r\n"
"%s",(int)response.length(), response.c_str()) > 0)
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment