Skip to content

Commit 1e95770

Browse files
quaesitor-scientiamRichard Wheelerclaude
authored
net.http: fix server_tls h2-negotiation test for default-on HTTP/2 (#27393)
test_server_tls_h2_negotiation asserted that a plain `http.fetch()` (no `enable_http2` field) is served as HTTP/1.1. That held before #27384, but #27384 flipped `enable_http2` to default `true`, so the client now advertises `h2` ALPN by default and the server correctly upgrades — making the test's `resp_h1.version() == .v1_1` assertion fail. This is currently red on master CI (clang/gcc/tcc-linux, clang-macos). The server behavior is correct; the test just needs to opt out explicitly. Pass `enable_http2: false` on the HTTP/1.1 leg, which is what the test means to exercise (server still serves h1 to a client that does not negotiate h2). Co-authored-by: Richard Wheeler <quaesitor.scientiam@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 95861b8 commit 1e95770

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

vlib/net/http/server_tls_test.v

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@ fn test_server_tls_h2_negotiation() {
126126
assert resp.status_code == 200
127127
assert resp.body == 'tls hello /h2'
128128

129-
// Without enable_http2 on the client, the server must keep speaking
130-
// HTTP/1.1 to the same listener.
129+
// With HTTP/2 disabled on the client, the server must keep speaking
130+
// HTTP/1.1 to the same listener. (enable_http2 defaults to true since
131+
// vlang/v#27384, so it must be opted out of explicitly here.)
131132
resp_h1 := http.fetch(
132-
url: 'https://127.0.0.1:${port}/h1'
133-
validate: false
133+
url: 'https://127.0.0.1:${port}/h1'
134+
enable_http2: false
135+
validate: false
134136
) or {
135137
assert false, 'h1 fetch failed: ${err}'
136138
return

0 commit comments

Comments
 (0)