]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
alt-svc: more liberal ALPN name parsing
authorDaniel Stenberg <daniel@haxx.se>
Fri, 2 Aug 2019 11:46:49 +0000 (13:46 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 3 Aug 2019 19:54:00 +0000 (21:54 +0200)
Allow pretty much anything to be part of the ALPN identifier. In
particular minus, which is used for "h3-20" (in-progress HTTP/3
versions) etc.

Updated test 356.
Closes #4182

lib/altsvc.c
tests/data/test356

index 85a4e01b5009d7eeb13cde0a3c0d40aa52d952ce..e4d3ea60568b23effabf8a53da20585e2015eaa1 100644 (file)
@@ -343,7 +343,7 @@ static CURLcode getalnum(const char **ptr, char *alpnbuf, size_t buflen)
   while(*p && ISBLANK(*p))
     p++;
   protop = p;
-  while(*p && ISALNUM(*p))
+  while(*p && !ISBLANK(*p) && (*p != ';') && (*p != '='))
     p++;
   len = p - protop;
 
index e2ac4860d497bacad3dc723ab9125e1017866793..1be05fe6f499d82f455cf161592f8e0241190f55 100644 (file)
@@ -16,7 +16,7 @@ Content-Length: 6
 Connection: close
 Content-Type: text/html
 Funny-head: yesyes
-Alt-Svc: h1="nowhere.foo:81"
+Alt-Svc: h1="nowhere.foo:81", un-kno22!wn=":82"
 
 -foo-
 </data>