diff options
Diffstat (limited to 'src/rest/gnunet-rest-server.c')
-rw-r--r-- | src/rest/gnunet-rest-server.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c index b2357bdf3..ba18c5dfa 100644 --- a/src/rest/gnunet-rest-server.c +++ b/src/rest/gnunet-rest-server.c | |||
@@ -336,20 +336,17 @@ create_response (void *cls, | |||
336 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 336 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
337 | "Queueing response from plugin with MHD\n"); | 337 | "Queueing response from plugin with MHD\n"); |
338 | //Handle Preflights | 338 | //Handle Preflights |
339 | if (0 == strcmp(meth, MHD_HTTP_METHOD_OPTIONS)) | 339 | if (NULL != allow_origin) |
340 | { | 340 | { |
341 | if (NULL != allow_origin) | 341 | MHD_add_response_header (con_handle->response, |
342 | { | 342 | MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, |
343 | MHD_add_response_header (con_handle->response, | 343 | allow_origin); |
344 | MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, | 344 | } |
345 | allow_origin); | 345 | if (NULL != allow_headers) |
346 | } | 346 | { |
347 | if (NULL != allow_headers) | 347 | MHD_add_response_header (con_handle->response, |
348 | { | 348 | "Access-Control-Allow-Headers", |
349 | MHD_add_response_header (con_handle->response, | 349 | allow_headers); |
350 | "Access-Control-Allow-Headers", | ||
351 | allow_headers); | ||
352 | } | ||
353 | } | 350 | } |
354 | int ret = MHD_queue_response (con, | 351 | int ret = MHD_queue_response (con, |
355 | con_handle->status, | 352 | con_handle->status, |