commit dbfc626851e75b10b916e9a6b265d28b13034649
parent 2da68223f72bf8ede3dc300a4ddc166fe66f5891
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 8 Jan 2020 10:38:44 +0100
use TALER_MHD_add_global_headers() to set Connection: close and CORS header
Diffstat:
2 files changed, 7 insertions(+), 28 deletions(-)
diff --git a/src/sync/sync-httpd_backup.c b/src/sync/sync-httpd_backup.c
@@ -81,10 +81,7 @@ SH_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,
- "*"));
+ TALER_MHD_add_global_headers (resp);
ret = MHD_queue_response (connection,
MHD_HTTP_NO_CONTENT,
resp);
@@ -122,10 +119,7 @@ SH_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,
- "*"));
+ TALER_MHD_add_global_headers (resp);
ret = MHD_queue_response (connection,
MHD_HTTP_NOT_MODIFIED,
resp);
@@ -223,10 +217,7 @@ 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,
- "*"));
+ TALER_MHD_add_global_headers (resp);
{
char *sig_s;
char *prev_s;
diff --git a/src/sync/sync-httpd_backup_post.c b/src/sync/sync-httpd_backup_post.c
@@ -221,10 +221,7 @@ 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,
- "*"));
+ TALER_MHD_add_global_headers (resp);
{
char *hdr;
@@ -769,10 +766,7 @@ SH_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,
- "*"));
+ TALER_MHD_add_global_headers (resp);
ret = MHD_queue_response (connection,
MHD_HTTP_NOT_MODIFIED,
resp);
@@ -910,10 +904,7 @@ SH_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,
- "*"));
+ TALER_MHD_add_global_headers (resp);
ret = MHD_queue_response (connection,
MHD_HTTP_NOT_MODIFIED,
resp);
@@ -931,10 +922,7 @@ SH_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,
- "*"));
+ TALER_MHD_add_global_headers (resp);
ret = MHD_queue_response (connection,
MHD_HTTP_NO_CONTENT,
resp);