gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: no leho cors


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: no leho cors
Date: Tue, 20 Nov 2018 14:12:03 +0100

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

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 8f587cf6e no leho cors
     new f69adb8a1 Merge branch 'master' of git+ssh://gnunet.org/gnunet
8f587cf6e is described below

commit 8f587cf6e19d65bbaf277ddc18d8e0bb72e7c26f
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Tue Nov 20 14:11:48 2018 +0100

    no leho cors
---
 src/gns/gnunet-gns-proxy.c | 43 ++++++++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 19 deletions(-)

diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index a502e0b65..bec5360ca 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -1230,9 +1230,7 @@ curl_check_hdr (void *buffer,
     goto cleanup;
   }
   if ((0 == strcasecmp (MHD_HTTP_HEADER_LOCATION,
-                      hdr_type)) ||
-      (0 == strcasecmp (MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
-       hdr_type)))
+                      hdr_type)))
   {
     char *leho_host;
 
@@ -1256,6 +1254,29 @@ curl_check_hdr (void *buffer,
     }
     GNUNET_free (leho_host);
   }
+  if (0 == strcasecmp (MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
+       hdr_type))
+  {
+    char *leho_host;
+
+    GNUNET_asprintf (&leho_host,
+                     (HTTPS_PORT != s5r->port)
+                     ? "http://%s";
+                     : "https://%s";,
+                     s5r->leho);
+    if (0 == strncmp (leho_host,
+                      hdr_val,
+                      strlen (leho_host)))
+    {
+      GNUNET_asprintf (&new_location,
+                       "%s%s",
+                       (HTTPS_PORT != s5r->port)
+                       ? "http://";
+                       : "https://";,
+                       s5r->domain);
+      hdr_val = new_location;
+    }
+
   /* MHD does not allow certain characters in values, remove those */
   if (NULL != (tok = strchr (hdr_val, '\n')))
     *tok = '\0';
@@ -1337,22 +1358,6 @@ create_mhd_response_from_s5r (struct Socks5Request *s5r)
                                            header->value));
 
   }
-  if (NULL != s5r->leho)
-  {
-    char *cors_hdr;
-
-    GNUNET_asprintf (&cors_hdr,
-                     (HTTPS_PORT == s5r->port)
-                     ? "https://%s";
-                     : "http://%s";,
-                     s5r->leho);
-
-    GNUNET_break (MHD_YES ==
-                  MHD_add_response_header (s5r->response,
-                                           
MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
-                                           cors_hdr));
-    GNUNET_free (cors_hdr);
-  }
   /* force connection to be closed after each request, as we
      do not support HTTP pipelining (yet, FIXME!) */
   /*GNUNET_break (MHD_YES ==

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



reply via email to

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