summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_responses.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-09-14 21:07:43 +0200
committerChristian Grothoff <christian@grothoff.org>2017-09-14 21:07:43 +0200
commit1c3e78724343e48c9fbc26b9985085b5d25ba540 (patch)
tree96eadc9e377b0dd5fc36d55e34f42064f03cd588 /src/exchange/taler-exchange-httpd_responses.c
parentf346e89ceb7eecf6de1abd4b2b794926d671b72c (diff)
downloadexchange-1c3e78724343e48c9fbc26b9985085b5d25ba540.tar.gz
exchange-1c3e78724343e48c9fbc26b9985085b5d25ba540.tar.bz2
exchange-1c3e78724343e48c9fbc26b9985085b5d25ba540.zip
be more precise about encoding HTTP bodies
Diffstat (limited to 'src/exchange/taler-exchange-httpd_responses.c')
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index c31c248f5..bde14d815 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;
}