diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/http/h2_bundle.go | 7 | ||||
-rw-r--r-- | src/net/lookup_test.go | 24 |
2 files changed, 9 insertions, 22 deletions
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go index 381f91c8ad..3a21ecac3d 100644 --- a/src/net/http/h2_bundle.go +++ b/src/net/http/h2_bundle.go @@ -5760,12 +5760,6 @@ func (sc *http2serverConn) newWriterAndRequest(st *http2stream, f *http2MetaHead return nil, nil, sc.countError("bad_path_method", http2streamError(f.StreamID, http2ErrCodeProtocol)) } - bodyOpen := !f.StreamEnded() - if rp.method == "HEAD" && bodyOpen { - // HEAD requests can't have bodies - return nil, nil, sc.countError("head_body", http2streamError(f.StreamID, http2ErrCodeProtocol)) - } - rp.header = make(Header) for _, hf := range f.RegularFields() { rp.header.Add(sc.canonicalHeader(hf.Name), hf.Value) @@ -5778,6 +5772,7 @@ func (sc *http2serverConn) newWriterAndRequest(st *http2stream, f *http2MetaHead if err != nil { return nil, nil, err } + bodyOpen := !f.StreamEnded() if bodyOpen { if vv, ok := rp.header["Content-Length"]; ok { if cl, err := strconv.ParseUint(vv[0], 10, 63); err == nil { diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go index 655543c7d2..32e7f8ef99 100644 --- a/src/net/lookup_test.go +++ b/src/net/lookup_test.go @@ -49,21 +49,21 @@ var lookupGoogleSRVTests = []struct { cname, target string }{ { - "xmpp-server", "tcp", "google.com", + "ldap", "tcp", "google.com", "google.com.", "google.com.", }, { - "xmpp-server", "tcp", "google.com.", + "ldap", "tcp", "google.com.", "google.com.", "google.com.", }, // non-standard back door { - "", "", "_xmpp-server._tcp.google.com", + "", "", "_ldap._tcp.google.com", "google.com.", "google.com.", }, { - "", "", "_xmpp-server._tcp.google.com.", + "", "", "_ldap._tcp.google.com.", "google.com.", "google.com.", }, } @@ -71,10 +71,6 @@ var lookupGoogleSRVTests = []struct { var backoffDuration = [...]time.Duration{time.Second, 5 * time.Second, 30 * time.Second} func TestLookupGoogleSRV(t *testing.T) { - // TODO(mknyszek): Figure out next steps for this test. This is just - // a quick fix. - t.Skip("fails consistently due to an upstream DNS change; see #56707.") - t.Parallel() mustHaveExternalNetwork(t) @@ -635,10 +631,6 @@ func TestLookupDotsWithLocalSource(t *testing.T) { } func TestLookupDotsWithRemoteSource(t *testing.T) { - // TODO(mknyszek): Figure out next steps for this test. This is just - // a quick fix. - t.Skip("fails consistently due to an upstream DNS change; see #56707.") - if runtime.GOOS == "darwin" || runtime.GOOS == "ios" { testenv.SkipFlaky(t, 27992) } @@ -709,16 +701,16 @@ func testDots(t *testing.T, mode string) { } } - cname, srvs, err := LookupSRV("xmpp-server", "tcp", "google.com") + cname, srvs, err := LookupSRV("ldap", "tcp", "google.com") if err != nil { - t.Errorf("LookupSRV(xmpp-server, tcp, google.com): %v (mode=%v)", err, mode) + t.Errorf("LookupSRV(ldap, tcp, google.com): %v (mode=%v)", err, mode) } else { if !hasSuffixFold(cname, ".google.com.") { - t.Errorf("LookupSRV(xmpp-server, tcp, google.com) returned cname=%v, want name ending in .google.com. with trailing dot (mode=%v)", cname, mode) + t.Errorf("LookupSRV(ldap, tcp, google.com) returned cname=%v, want name ending in .google.com. with trailing dot (mode=%v)", cname, mode) } for _, srv := range srvs { if !hasSuffixFold(srv.Target, ".google.com.") { - t.Errorf("LookupSRV(xmpp-server, tcp, google.com) returned addrs=%v, want names ending in .google.com. with trailing dot (mode=%v)", srvString(srvs), mode) + t.Errorf("LookupSRV(ldap, tcp, google.com) returned addrs=%v, want names ending in .google.com. with trailing dot (mode=%v)", srvString(srvs), mode) break } } |