You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
alt-svc: a percent-encoded protocol-id (http%2F1.1) is not recognised, while the unencoded http/1.1 is #23654
and curl is run with --alt-svc cache.txt. curl writes the cache file, but it contains no entry.
RFC 7838 §3 defines protocol-id = token ; percent-encoded ALPN protocol name and says "Octets not allowed in tokens […] MUST be percent-encoded". / is not a tchar, so http%2F1.1 is the only conforming way to name http/1.1.
Measured with curl 8.21.0 (x86_64-w64-mingw32, Schannel) and 8.14.1 (x86_64-pc-linux-gnu, OpenSSL), with the server sending one value at a time:
Alt-Svc sent
recorded
h2=":8443"
h2
h3=":8443"
h3
h1=":8443"
h1
http/1.1=":8443" (not a token)
h1
http%2F1.1=":8443"
nothing
Curl_altsvc_parse (lib/altsvc.c) passes the text before = unchanged to Curl_alpn2alpnid (lib/connect.c). That function compares it with the literals h1, h2, h3 and http/1.1. So the conforming spelling is skipped as an unknown protocol, and the non-conforming one is accepted. Current master looks the same.
I expected the following
curl percent-decodes the protocol-id before mapping it, so http%2F1.1 is recorded as h1.
RFC 7838, Section 3 indeed defines the "protocol-id" as "percent encoded ALPN protocol name".
interesting. also the hex must be uppercase, for comparison purposes i assume
In order to have precisely one way to represent any ALPN protocol
name, the following additional constraints apply:
1. Octets in the ALPN protocol name MUST NOT be percent-encoded if
they are valid token characters except "%", and
2. When using percent-encoding, uppercase hex digits MUST be used.
Activity
Link curl/curl#23654 where the Alt-Svc deviation is pinned
icing commentedon Oct 28, 2026
Every day you learn something new. RFC 7838, Section 3 indeed defines the "protocol-id" as "percent encoded ALPN protocol name".
So, your server is not incorrect. Just surprising.
altsvc: percent-decode the protocol-id before mapping
altsvc: percent-decode the protocol-id before mapping
altsvc: percent-decode the protocol-id before mapping
jay commentedon Oct 28, 2026
interesting. also the hex must be uppercase, for comparison purposes i assume
altsvc: percent-decode the protocol-id before mapping
altsvc: percent-decode the protocol-id before mapping
altsvc: percent-decode the protocol-id before mapping