From f2c955529345f80854aa728c748e042a1d835841 Mon Sep 17 00:00:00 2001 From: Amer Ather Date: Mon, 1 Dec 2014 22:06:30 +0000 Subject: [PATCH] Added one more ACAO header --- src/pmwebapi/pmresapi.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pmwebapi/pmresapi.cxx b/src/pmwebapi/pmresapi.cxx index a657b72..1301e30 100644 --- a/src/pmwebapi/pmresapi.cxx +++ b/src/pmwebapi/pmresapi.cxx @@ -158,6 +158,10 @@ pmwebres_respond (struct MHD_Connection *connection, const http_params& params, if (rc != MHD_YES) { connstamp (cerr, connection) << "MHD_add_response_header Location: failed" << endl; } + + /* Adding ACAO header */ + (void) MHD_add_response_header (resp, "Access-Control-Allow-Origin", "*"); + rc = MHD_queue_response (connection, MHD_HTTP_FOUND /* 302 */ , resp); if (rc != MHD_YES) { connstamp (cerr, connection) << "MHD_queue_response failed" << endl; @@ -209,8 +213,7 @@ pmwebres_respond (struct MHD_Connection *connection, const http_params& params, (void) MHD_add_response_header (resp, "Cache-Control", "public"); - // Per Frank suggestion, added this header to have javascript - // ability to list files at the url served by pmwebd + /* Adding ACAO header */ (void) MHD_add_response_header (resp, "Access-Control-Allow-Origin", "*"); -- 1.8.4.2