Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/http/HTTPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ void HTTPResponse::SetHeader(const string &key, const string &value) {
* @return true on success, false on error
*/
int HTTPResponse::SendJson(const JsonValue &json) {
SetHeader(MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, "*");
const string output = JsonWriter::AsString(json);
struct MHD_Response *response = HTTPServer::BuildResponse(
static_cast<void*>(const_cast<char*>(output.data())),
Expand All @@ -412,6 +413,7 @@ int HTTPResponse::SendJson(const JsonValue &json) {
* @return true on success, false on error
*/
int HTTPResponse::Send() {
SetHeader(MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, "*");
HeadersMultiMap::const_iterator iter;
struct MHD_Response *response = HTTPServer::BuildResponse(
static_cast<void*>(const_cast<char*>(m_data.data())),
Expand Down