commit e462042a4d7ce91c0731871f014b78e6906b4171
parent 386aee464494ff6dfb6d7b51825e398ef1462ba9
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 23 Nov 2019 08:28:33 +0100
disable CORS
Diffstat:
3 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/sync/sync-httpd_backup.c b/src/sync/sync-httpd_backup.c
@@ -71,6 +71,10 @@ sync_handler_backup_get (struct MHD_Connection *connection,
resp = MHD_create_response_from_buffer (0,
NULL,
MHD_RESPMEM_PERSISTENT);
+ GNUNET_break (MHD_YES ==
+ MHD_add_response_header (resp,
+ MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
+ "*"));
ret = MHD_queue_response (connection,
MHD_HTTP_NO_CONTENT,
resp);
@@ -107,6 +111,10 @@ sync_handler_backup_get (struct MHD_Connection *connection,
resp = MHD_create_response_from_buffer (0,
NULL,
MHD_RESPMEM_PERSISTENT);
+ GNUNET_break (MHD_YES ==
+ MHD_add_response_header (resp,
+ MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
+ "*"));
ret = MHD_queue_response (connection,
MHD_HTTP_NOT_MODIFIED,
resp);
@@ -193,6 +201,10 @@ SH_return_backup (struct MHD_Connection *connection,
resp = MHD_create_response_from_buffer (backup_size,
backup,
MHD_RESPMEM_MUST_FREE);
+ GNUNET_break (MHD_YES ==
+ MHD_add_response_header (resp,
+ MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
+ "*"));
{
char *sig_s;
char *prev_s;
diff --git a/src/sync/sync-httpd_backup_post.c b/src/sync/sync-httpd_backup_post.c
@@ -218,6 +218,10 @@ make_payment_request (const char *order_id)
resp = MHD_create_response_from_buffer (0,
NULL,
MHD_RESPMEM_PERSISTENT);
+ GNUNET_break (MHD_YES ==
+ MHD_add_response_header (resp,
+ MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
+ "*"));
{
char *hdr;
@@ -689,6 +693,10 @@ sync_handler_backup_post (struct MHD_Connection *connection,
resp = MHD_create_response_from_buffer (0,
NULL,
MHD_RESPMEM_PERSISTENT);
+ GNUNET_break (MHD_YES ==
+ MHD_add_response_header (resp,
+ MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
+ "*"));
ret = MHD_queue_response (connection,
MHD_HTTP_NOT_MODIFIED,
resp);
@@ -791,6 +799,10 @@ sync_handler_backup_post (struct MHD_Connection *connection,
resp = MHD_create_response_from_buffer (0,
NULL,
MHD_RESPMEM_PERSISTENT);
+ GNUNET_break (MHD_YES ==
+ MHD_add_response_header (resp,
+ MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
+ "*"));
ret = MHD_queue_response (connection,
MHD_HTTP_NOT_MODIFIED,
resp);
@@ -807,6 +819,10 @@ sync_handler_backup_post (struct MHD_Connection *connection,
resp = MHD_create_response_from_buffer (0,
NULL,
MHD_RESPMEM_PERSISTENT);
+ GNUNET_break (MHD_YES ==
+ MHD_add_response_header (resp,
+ MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
+ "*"));
ret = MHD_queue_response (connection,
MHD_HTTP_NO_CONTENT,
resp);
diff --git a/src/sync/sync-httpd_responses.c b/src/sync/sync-httpd_responses.c
@@ -60,6 +60,10 @@ SH_RESPONSE_make_json (const json_t *json)
}
GNUNET_break (MHD_YES ==
MHD_add_response_header (resp,
+ MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
+ "*"));
+ GNUNET_break (MHD_YES ==
+ MHD_add_response_header (resp,
MHD_HTTP_HEADER_CONTENT_TYPE,
"application/json"));
return resp;