From c03183d3e196645f955133867c0892c7f08769f5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 9 Feb 2019 15:43:47 +0100 Subject: avoid assertions from adding headers that MHD deals with internally --- src/gns/gnunet-gns-proxy.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/gns/gnunet-gns-proxy.c') diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index e21deabde..21451651d 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c @@ -1362,11 +1362,27 @@ create_mhd_response_from_s5r (struct Socks5Request *s5r) NULL != header; header = header->next) { - GNUNET_break (MHD_YES == - MHD_add_response_header (s5r->response, - header->type, - header->value)); - + if (0 == strcasecmp (header->type, + MHD_HTTP_HEADER_CONTENT_LENGTH)) + continue; /* MHD won't let us mess with those, for good reason */ + if ( (0 == strcasecmp (header->type, + MHD_HTTP_HEADER_TRANSFER_ENCODING)) && + ( (0 == strcasecmp (header->value, + "identity")) || + (0 == strcasecmp (header->value, + "chunked")) ) ) + continue; /* MHD won't let us mess with those, for good reason */ + if (MHD_YES != + MHD_add_response_header (s5r->response, + header->type, + header->value)) + { + GNUNET_break (0); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Failed to add header `%s:%s'\n", + header->type, + header->value); + } } /* force connection to be closed after each request, as we do not support HTTP pipelining (yet, FIXME!) */ -- cgit v1.2.3