Re: "502 Couldn't parse server headers"

Black Rider <[email protected]> Wed, 30 Mar 2016 13:45:51 +0000 (UTC)
Newsgroups gmane.comp.web.polipo.user
Message-ID <[email protected]>
A far from tested patch.

h2c Upgrades are ignored. Any other Upgrade content leads to a failed parse like in the previous behaviour.


--- http_parse.c	2016-01-30 16:13:31.000000000 +0100
+++ http_parse_new.c	2016-03-30 15:39:57.170391000 +0200
@@ -953,8 +953,8 @@
                 } while(h < 0);
                 hbuf_length = h;
             }
-        } else if(name == atomTrailer || name == atomUpgrade) {
-            do_log(L_ERROR, "Trailers or upgrade present.\n");
+        } else if(name == atomTrailer) {
+            do_log(L_ERROR, "Trailers present.\n");
             goto fail;
         } else if(name == atomDate || name == atomExpires ||
                   name == atomIfModifiedSince || 
@@ -1217,6 +1217,11 @@
                     do_log(L_VARY, ").\n");
                 }
                 cache_control.flags |= CACHE_VARY;
+	    } else if(name == atomUpgrade ) { //FIXME
+		    if(!token_compare(buf, value_start, value_end, "h2c")) {
+			    do_log(L_ERROR, "Upgrade header with a value different than h2c present.\n");
+            		    goto fail;
+		    }
             } else if(name == atomAuthorization) {
                 cache_control.flags |= CACHE_AUTHORIZATION;
             }


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140