summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-08 10:38:44 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-08 10:38:44 +0100
commitdbfc626851e75b10b916e9a6b265d28b13034649 (patch)
tree42075909f230166d2151fd8833d98e99d571fa02
parent2da68223f72bf8ede3dc300a4ddc166fe66f5891 (diff)
downloadsync-dbfc626851e75b10b916e9a6b265d28b13034649.tar.gz
sync-dbfc626851e75b10b916e9a6b265d28b13034649.tar.bz2
sync-dbfc626851e75b10b916e9a6b265d28b13034649.zip
use TALER_MHD_add_global_headers() to set Connection: close and CORS header
-rw-r--r--src/sync/sync-httpd_backup.c15
-rw-r--r--src/sync/sync-httpd_backup_post.c20
2 files changed, 7 insertions, 28 deletions
diff --git a/src/sync/sync-httpd_backup.c b/src/sync/sync-httpd_backup.c
index 0b4f6a0..e3da6b7 100644
--- 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
index cdec9fd..dc6310b 100644
--- 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);