The H2 mux properly drops userinfo from authority on input but doesn't
drop it on output if present on input (e.g. coming from H1), which will
cause a bad request when reaching a compliant H2 server such as itself.
Let's make sure it is properly dropped there as well, as required by
RFC9113. This should be backported to all stable versions.
Reported-by: Claude (ANT-2026-R03JNY63)
* from rfc 8441.
*/
struct ist scheme = { };
+ struct ist at;
if (uri.ptr[0] != '/' && uri.ptr[0] != '*') {
/* the URI seems to start with a scheme */
auth.len++;
uri = istadv(uri, auth.len);
+
+ /* RFC9113#8.3.1: :authority must not carry the deprecated userinfo */
+ at = istfind(auth, '@');
+ if (istlen(at))
+ auth = istadv(at, 1);
}
}