[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-challenger] branch master updated: fix #9420 + #9428
From: |
gnunet |
Subject: |
[taler-challenger] branch master updated: fix #9420 + #9428 |
Date: |
Sun, 29 Dec 2024 14:03:48 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository challenger.
The following commit(s) were added to refs/heads/master by this push:
new 5a683e3 fix #9420 + #9428
5a683e3 is described below
commit 5a683e3d59ca9c5ab43b298d46a4ebaa2fc11593
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Dec 29 14:03:46 2024 +0100
fix #9420 + #9428
---
src/challenger/challenger-httpd_common.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/challenger/challenger-httpd_common.c
b/src/challenger/challenger-httpd_common.c
index 854c2c3..bcbf7dc 100644
--- a/src/challenger/challenger-httpd_common.c
+++ b/src/challenger/challenger-httpd_common.c
@@ -32,18 +32,20 @@
int
CH_get_output_type (struct MHD_Connection *connection)
{
- int output_type;
+ const char *mime;
+ double q_html;
+ double q_json;
- output_type
- = TALER_MHD_check_accept (connection,
- MHD_HTTP_HEADER_ACCEPT,
- "text/html",
- "application/json",
- NULL);
- if (output_type < 0)
- output_type = 0; /* default to HTML */
- GNUNET_assert (output_type < 2);
- return output_type;
+ mime = MHD_lookup_connection_value (connection,
+ MHD_HEADER_KIND,
+ MHD_HTTP_HEADER_ACCEPT);
+ if (NULL == mime)
+ return 0; /* default to HTML */
+ q_html = TALER_pattern_matches (mime,
+ "text/html");
+ q_json = TALER_pattern_matches (mime,
+ "application/json");
+ return (q_html > q_json) ? 0 : 1;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-challenger] branch master updated: fix #9420 + #9428,
gnunet <=