gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix mime-type matching (#7882)


From: gnunet
Subject: [taler-exchange] branch master updated: fix mime-type matching (#7882)
Date: Wed, 05 Jul 2023 18:18:26 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 40dfb94e fix mime-type matching (#7882)
40dfb94e is described below

commit 40dfb94e0f16928cc79147671492e58b827e2251
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Jul 5 18:18:23 2023 +0200

    fix mime-type matching (#7882)
---
 src/mhd/mhd_legal.c                | 11 ++++++++---
 src/testing/test_exchange_api.conf |  2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/mhd/mhd_legal.c b/src/mhd/mhd_legal.c
index 2c412711..bec33cd4 100644
--- a/src/mhd/mhd_legal.c
+++ b/src/mhd/mhd_legal.c
@@ -126,10 +126,14 @@ mime_matches (const char *accept_pattern,
 {
   const char *da = strchr (accept_pattern, '/');
   const char *dm = strchr (mime, '/');
+  const char *end;
 
   if ( (NULL == da) ||
        (NULL == dm) )
     return (0 == strcmp ("*", accept_pattern));
+  end = strchr (da, ';');
+  if (NULL == end)
+    end = &da[strlen (da)];
   return
     ( ( (1 == da - accept_pattern) &&
         ('*' == *accept_pattern) ) ||
@@ -138,8 +142,9 @@ mime_matches (const char *accept_pattern,
                            mime,
                            da - accept_pattern)) ) ) &&
     ( (0 == strcmp (da, "/*")) ||
-      (0 == strcasecmp (da,
-                        dm)) );
+      (0 == strncasecmp (da,
+                         dm,
+                         end - da)) );
 }
 
 
@@ -150,7 +155,7 @@ TALER_MHD_xmime_matches (const char *accept_pattern,
   char *ap = GNUNET_strdup (accept_pattern);
   char *sptr;
 
-  for (const char *tok = strtok_r (ap, ";", &sptr);
+  for (const char *tok = strtok_r (ap, ",", &sptr);
        NULL != tok;
        tok = strtok_r (NULL, ";", &sptr))
   {
diff --git a/src/testing/test_exchange_api.conf 
b/src/testing/test_exchange_api.conf
index b7f8c5c6..c0e4d2f4 100644
--- a/src/testing/test_exchange_api.conf
+++ b/src/testing/test_exchange_api.conf
@@ -21,7 +21,7 @@ CONFIG = "postgres:///talercheck"
 HTTP_PORT = 8082
 
 [exchange]
-TERMS_ETAG = 0
+TERMS_ETAG = tos
 PRIVACY_ETAG = 0
 AML_THRESHOLD = EUR:1000000
 PORT = 8081

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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