this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

pkg/net: work around upstream idna bug breaking net.FQDN validation

idna.StrictDomainName does not work without MapForLookup or
ValidateForRegistration, causing net.FQDN to accept any string
including those with spaces. Switch to MapForLookup as a workaround.

Fixes #2431.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I898fd8c244d09fa3850878ea981b32b8bcc24b72
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1235282
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+6 -5
+3 -2
pkg/net/host.go
··· 25 25 "cuelang.org/go/cue" 26 26 ) 27 27 28 + // TODO: revert to using ValidateLabels and StrictDomainName once 29 + // https://go.dev/issue/74848 is fixed. 28 30 var idnaProfile = idna.New( 29 - idna.ValidateLabels(true), 31 + idna.MapForLookup(), 30 32 idna.VerifyDNSLength(true), 31 - idna.StrictDomainName(true), 32 33 ) 33 34 34 35 // SplitHostPort splits a network address of the form "host:port",
+3 -3
pkg/net/testdata/gen.txtar
··· 115 115 116 116 // Regression test for https://cuelang.org/issue/2431. 117 117 // StrictDomainName was not being applied due to an upstream bug. 118 - t48: true 119 - t49: true 118 + t48: false 119 + t49: false 120 120 t50: true 121 - t51: true 121 + t51: false 122 122 t3: ["::%lo0", "80"] 123 123 t4: "mod.test:80" 124 124 t5: "[2001:db8::1]:80"