summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-08-02 13:46:49 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-08-02 13:49:41 +0200
commitabce9c86f52bd7a03d158d669e3e35ec2319f31f (patch)
tree2355deafd9d3b5b97d891d3b176b3534232de7fa
parent35116a8302e6e2b33065cdae4f6651b2b2d8865d (diff)
downloadcurl-bagder/altsvc-alpn-parse.tar.gz
alt-svc: more liberal ALPN name parsingbagder/altsvc-alpn-parse
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.
-rw-r--r--lib/altsvc.c2
-rw-r--r--tests/data/test3562
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/altsvc.c b/lib/altsvc.c
index 85a4e01b5..e4d3ea605 100644
--- a/lib/altsvc.c
+++ b/lib/altsvc.c
@@ -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;
diff --git a/tests/data/test356 b/tests/data/test356
index e2ac4860d..1be05fe6f 100644
--- a/tests/data/test356
+++ b/tests/data/test356
@@ -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>