gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated: be more precise abo


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: be more precise about encoding HTTP bodies
Date: Thu, 14 Sep 2017 21:07:51 +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 1c3e787  be more precise about encoding HTTP bodies
1c3e787 is described below

commit 1c3e78724343e48c9fbc26b9985085b5d25ba540
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Sep 14 21:07:43 2017 +0200

    be more precise about encoding HTTP bodies
---
 src/exchange/taler-exchange-httpd_keystate.c  |  9 +++++----
 src/exchange/taler-exchange-httpd_responses.c | 11 ++++++++++-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_keystate.c 
b/src/exchange/taler-exchange-httpd_keystate.c
index 32a619e..47b10a9 100644
--- a/src/exchange/taler-exchange-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -1496,10 +1496,11 @@ TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
                 MHD_add_response_header (response,
                                          MHD_HTTP_HEADER_CONTENT_TYPE,
                                          rh->mime_type));
-  if (MHD_YES !=
-      MHD_add_response_header (response,
-                              MHD_HTTP_HEADER_CONTENT_ENCODING,
-                              "deflate"))
+  if ( (MHD_YES == comp) &&
+       (MHD_YES !=
+        MHD_add_response_header (response,
+                                 MHD_HTTP_HEADER_CONTENT_ENCODING,
+                                 "deflate")) )
   {
     GNUNET_break (0);
     MHD_destroy_response (response);
diff --git a/src/exchange/taler-exchange-httpd_responses.c 
b/src/exchange/taler-exchange-httpd_responses.c
index c31c248..bde14d8 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -53,6 +53,11 @@ TEH_RESPONSE_add_global_headers (struct MHD_Response 
*response)
  *
  * @param connection connection to check
  * @return #MHD_YES if 'deflate' compression is allowed
+ *
+ * Note that right now we're ignoring q-values, which is technically
+ * not correct, and also do not support "*" anywhere but in a line by
+ * itself.  This should eventually be fixed, see also
+ * https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
  */
 int
 TEH_RESPONSE_can_compress (struct MHD_Connection *connection)
@@ -69,11 +74,15 @@ TEH_RESPONSE_can_compress (struct MHD_Connection 
*connection)
               "deflate");
   if (NULL == de)
     return MHD_NO;
+  if (0 == strcmp (de,
+                   "*"))
+    return MHD_YES;
   if ( ( (de == ae) ||
         ( de[-1] == ',') ||
         (de[-1] == ' ') ) &&
        ( (de[strlen ("deflate")] == '\0') ||
-        (de[strlen ("deflate")] == ',') ) )
+        (de[strlen ("deflate")] == ',') ||
+         (de[strlen ("deflate")] == ';') ) )
     return MHD_YES;
   return MHD_NO;
 }

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



reply via email to

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