gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-sync] branch master updated: fix #6031


From: gnunet
Subject: [taler-sync] branch master updated: fix #6031
Date: Fri, 17 Jan 2020 00:20:59 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository sync.

The following commit(s) were added to refs/heads/master by this push:
     new ac923e9  fix #6031
ac923e9 is described below

commit ac923e939b6acf141f7ca101b41a18bae9e54d83
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Jan 17 00:20:57 2020 +0100

    fix #6031
---
 src/sync/sync-httpd.c | 48 ++++++++++++++++++++++++++++++------------------
 1 file changed, 30 insertions(+), 18 deletions(-)

diff --git a/src/sync/sync-httpd.c b/src/sync/sync-httpd.c
index 14b2470..7b9587b 100644
--- a/src/sync/sync-httpd.c
+++ b/src/sync/sync-httpd.c
@@ -240,6 +240,11 @@ url_handler (void *cls,
                                              upload_data,
                                              upload_data_size);
     }
+    if (0 == strcasecmp (method,
+                         MHD_HTTP_METHOD_OPTIONS))
+    {
+      return TALER_MHD_reply_cors_preflight (connection);
+    }
     if (0 == strcasecmp (method,
                          MHD_HTTP_METHOD_GET))
     {
@@ -270,27 +275,34 @@ url_handler (void *cls,
   {
     struct SH_RequestHandler *rh = &handlers[i];
 
-    if ( (0 == strcmp (url,
-                       rh->url)) &&
-         ( (NULL == rh->method) ||
-           (0 == strcasecmp (method,
-                             rh->method)) ) )
+    if (0 == strcmp (url,
+                     rh->url))
     {
-      int ret;
-
-      ret = rh->handler (rh,
-                         connection,
-                         con_cls,
-                         upload_data,
-                         upload_data_size);
-      hc = *con_cls;
-      if (NULL != hc)
+      if (0 == strcasecmp (method,
+                           MHD_HTTP_METHOD_OPTIONS))
       {
-        /* Store the async context ID, so we can restore it if
-         * we get another callack for this request. */
-        hc->async_scope_id = aid;
+        return TALER_MHD_reply_cors_preflight (connection);
+      }
+      if ( (NULL == rh->method) ||
+           (0 == strcasecmp (method,
+                             rh->method)) )
+      {
+        int ret;
+
+        ret = rh->handler (rh,
+                           connection,
+                           con_cls,
+                           upload_data,
+                           upload_data_size);
+        hc = *con_cls;
+        if (NULL != hc)
+        {
+          /* Store the async context ID, so we can restore it if
+           * we get another callack for this request. */
+          hc->async_scope_id = aid;
+        }
+        return ret;
       }
-      return ret;
     }
   }
   return SH_MHD_handler_static_response (&h404,

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]