Commit 846ebce
authored
fix(http): send default User-Agent; harden flaky 06 http/ssrf e2e (#270)
The durable HTTP client (reqwest) previously sent no User-Agent header.
Some hosts reject anonymous requests: httpbingo.org (fly.io) returns HTTP
402 to any request without a User-Agent, which made the redirect test
assert 3xx but receive 402, and silently let the other httpbingo tests
"pass" on a 402 instead of a real success response.
Product fix:
- build_client() now sets a default User-Agent of "pg_durable/<version>".
Nodes may still override it via an explicit User-Agent header.
Test hardening (06_http_and_ssrf.sql):
- Move the redirect test (Test 8) off httpbin.org (frequently unavailable;
the dominant CI flake) onto httpbingo.org/status/302, inheriting the
default 30s timeout.
- Remove the residual-PUBLIC-grant permission test: it only exercised stock
PostgreSQL grant semantics (a PUBLIC grant survives an additive per-role
grant) and asserted nothing pg_durable-specific. Renumber the superuser
bypass test accordingly.
Harness fix (scripts/test-e2e-local.sh):
- The repeat-run re-grant path (grant_e2e_df_usage) used the default
include_http => false, so on runs >= 2 (after the extension is dropped
and recreated) df_e2e_user lost HTTP access and 06 failed at the first
df.http() call. Pass include_http => true to mirror 00_setup_playground,
fixing `./scripts/test-e2e-local.sh 06_http_and_ssrf N`.
Verified: 06_http_and_ssrf now passes 3/3 in repeat mode against a reused
database. A separate, pre-existing BGW cold-start "pending" timeout flake
on the first instance remains out of scope (tracked for a retry harness).1 parent 20cef43 commit 846ebce
3 files changed
Lines changed: 14 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
| 583 | + | |
| 584 | + | |
583 | 585 | | |
584 | 586 | | |
585 | 587 | | |
586 | | - | |
| 588 | + | |
587 | 589 | | |
588 | 590 | | |
589 | 591 | | |
| |||
937 | 939 | | |
938 | 940 | | |
939 | 941 | | |
940 | | - | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | | - | |
957 | | - | |
958 | | - | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
968 | 945 | | |
969 | 946 | | |
970 | 947 | | |
| |||
976 | 953 | | |
977 | 954 | | |
978 | 955 | | |
979 | | - | |
| 956 | + | |
980 | 957 | | |
981 | 958 | | |
982 | 959 | | |
| |||
995 | 972 | | |
996 | 973 | | |
997 | 974 | | |
998 | | - | |
| 975 | + | |
999 | 976 | | |
1000 | 977 | | |
1001 | 978 | | |
| |||
0 commit comments