]> err.no Git - varnish/commitdiff
Fix two bugs in esi parsing:
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 10 Jul 2008 20:49:45 +0000 (20:49 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 10 Jul 2008 20:49:45 +0000 (20:49 +0000)
Ignore unknown include attributes and
Warn about src attributes without value

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2924 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_vrt_esi.c

index e7897f0e178539e19ef9b7675f97091f76b98b55..63908cea3f5b58a4aa9a4a7c6225cccaba2687e1 100644 (file)
@@ -277,10 +277,13 @@ esi_addinclude(struct esi_work *ew, txt t)
                VSL(SLT_Debug, 0, "<%.*s> -> <%.*s>",
                    tag.e - tag.b, tag.b,
                    val.e - val.b, val.b);
-               if (Tlen(tag) != 3 && memcmp(tag.b, "src", 3))
+               if (Tlen(tag) != 3 || memcmp(tag.b, "src", 3))
+                       continue; 
+               if (Tlen(val) == 0) {
+                       esi_error(ew, tag.b, Tlen(tag),
+                           "ESI esi:include src attribute withou value");
                        continue;
-
-               assert(Tlen(val) > 0);  /* XXX */
+               }
 
                if (Tlen(val) > 7 && !memcmp(val.b, "http://", 7)) {
                        /*  Rewrite to Host: header inplace */