This commit is contained in:
lifenjoiner 2023-02-03 23:23:57 +08:00 committed by GitHub
parent e1c7ea1770
commit 683aad75da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -506,14 +506,14 @@ func (xTransport *XTransport) Fetch(
altPort := uint16(port & 0xffff)
for i, xalt := range alt {
for j, v := range strings.Split(xalt, ";") {
if i > 8 || j > 16 {
if i >= 8 || j >= 16 {
break
}
v = strings.TrimSpace(v)
if strings.HasPrefix(v, "h3=\":") {
v = strings.TrimPrefix(v, "h3=\":")
v = strings.TrimSuffix(v, "\"")
if xAltPort, err := strconv.ParseUint(v, 10, 16); err == nil && xAltPort <= 65536 {
if xAltPort, err := strconv.ParseUint(v, 10, 16); err == nil && xAltPort <= 65535 {
altPort = uint16(xAltPort)
dlog.Debugf("Using HTTP/3 for [%s]", url.Host)
break