summaryrefslogtreecommitdiff
path: root/src/mhd
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-18 20:50:25 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-18 20:50:25 +0100
commit6fc2a5f9493e614a458cfc57ad42c782d06ba07a (patch)
tree14dcd68aa3bbf9f226d7b1e121c04d2019cd8675 /src/mhd
parentc1996b7e69d7cb51adbd687b3a1cffdc02e28d3c (diff)
downloadexchange-6fc2a5f9493e614a458cfc57ad42c782d06ba07a.tar.gz
exchange-6fc2a5f9493e614a458cfc57ad42c782d06ba07a.tar.bz2
exchange-6fc2a5f9493e614a458cfc57ad42c782d06ba07a.zip
fixes
Diffstat (limited to 'src/mhd')
-rw-r--r--src/mhd/mhd_responses.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mhd/mhd_responses.c b/src/mhd/mhd_responses.c
index aeb3b0b69..6e5181482 100644
--- a/src/mhd/mhd_responses.c
+++ b/src/mhd/mhd_responses.c
@@ -278,20 +278,26 @@ int
TALER_MHD_reply_cors_preflight (struct MHD_Connection *connection)
{
struct MHD_Response *resp;
+ int ret;
- GNUNET_assert (NULL != (resp = MHD_create_response_from_buffer (0, NULL,
- MHD_RESPMEM_PERSISTENT)));
+ resp = MHD_create_response_from_buffer (0,
+ NULL,
+ MHD_RESPMEM_PERSISTENT);
+ if (NULL == resp)
+ return MHD_NO;
/* This adds the Access-Control-Allow-Origin header.
* All endpoints of the exchange allow CORS. */
TALER_MHD_add_global_headers (resp);
GNUNET_break (MHD_YES ==
MHD_add_response_header (resp,
- // Not available as MHD constant yet
+ /* Not available as MHD constant yet */
"Access-Control-Allow-Headers",
"*"));
- GNUNET_assert (MHD_YES == MHD_queue_response (connection, MHD_HTTP_NO_CONTENT,
- resp));
- return MHD_YES;
+ ret = MHD_queue_response (connection,
+ MHD_HTTP_NO_CONTENT,
+ resp);
+ MHD_destroy_response (resp);
+ return ret;
}