Commit 8a12d24
committed
fix(test): close three latent OkHttp-port gaps flagged in review
- OBPReq.toOkHttpRequest: dedupe headers by name (case-insensitive)
before sending, keeping the last value. reqHeaders accumulated via
<:</addHeader without removing same-named entries, so a caller-set
header plus a helper default (e.g. makePostRequest's Content-Type)
would be sent twice on the wire instead of the helper default
overriding, as the pre-port Map-based header merge did.
- OBPReq./ path-segment encoding: percent-encode '%' itself (first,
before the other reserved characters). Without it, a literal '%' in
a test id/label either makes HttpUrl.parse reject the segment as an
invalid escape, or — if it happens to look like a valid escape (e.g.
"%2F") — gets silently decoded server-side into the wrong resource.
- SendServerRequests.getAPIResponse: restore the retry-once-on-IOException
the old dispatch-based client had for a corrupted pooled connection
(one test's error response polluting a connection OkHttp's own
RetryAndFollowUpInterceptor won't recover from). Broadened from the
old code's single string-matched exception to java.io.IOException
generally, since OkHttp surfaces this as various IOException subtypes
rather than one specific message.
All three are additive/defensive — none change behaviour for any
currently-passing test. Verified with two full local runs
(run_tests_parallel.sh, JDK 25): 2921 tests, 0 failures, 0 errors.1 parent 34ea57b commit 8a12d24
2 files changed
Lines changed: 33 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
90 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
91 | 107 | | |
92 | 108 | | |
93 | 109 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
120 | 133 | | |
121 | 134 | | |
122 | 135 | | |
| |||
0 commit comments