Skip to content

Commit 6297d5a

Browse files
authored
Merge pull request #591 from MDA2AV/validate-h2-only
hotfix validate.sh for h2 or h3 only frameworks
2 parents 960fd7b + 7247b6e commit 6297d5a

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

scripts/validate.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,32 @@ if [ "$GATEWAY_ONLY" = "false" ]; then
155155
docker rm -f "$CONTAINER_NAME" 2>/dev/null || true
156156
docker run "${docker_args[@]}" "$IMAGE_NAME"
157157

158-
# Wait for server to start
158+
# Wait for server to start.
159+
#
160+
# Primary probe is GET /baseline11 over plaintext HTTP/1.1 on $PORT — that
161+
# works for the vast majority of frameworks, which all listen on 8080.
162+
# H/2-only or H/3-only frameworks (e.g. wtx, which speaks h2c on 8080 or
163+
# h2/h3 on 8443 depending on build) never respond to an HTTP/1.1 request
164+
# and would otherwise time out. Fall back to GET /baseline2 over HTTPS
165+
# with ALPN h2 on $H2PORT when the framework subscribes to any h2 or h3
166+
# profile. H/3 servers still advertise h2 on the same TLS listener via
167+
# ALPN, so this single fallback covers both cases without requiring
168+
# curl to be built with HTTP/3 support.
169+
need_tls_probe=false
170+
if has_test "baseline-h2" || has_test "static-h2" \
171+
|| has_test "baseline-h3" || has_test "static-h3"; then
172+
need_tls_probe=true
173+
fi
174+
159175
echo "[wait] Waiting for server..."
160176
for i in $(seq 1 30); do
161177
if curl -s --max-time 2 -o /dev/null -w '' "http://localhost:$PORT/baseline11?a=1&b=1" 2>/dev/null; then
162178
break
163179
fi
180+
if [ "$need_tls_probe" = "true" ] && \
181+
curl -sk --http2 --max-time 2 -o /dev/null -w '' "https://localhost:$H2PORT/baseline2?a=1&b=1" 2>/dev/null; then
182+
break
183+
fi
164184
if [ "$i" -eq 30 ]; then
165185
echo "FAIL: Server did not start within 30s"
166186
exit 1

0 commit comments

Comments
 (0)