Commit 6e3bb87
test(presign): cover the scheme-fallback branch in rewritePresignHost
Diff-cover round 2 flagged storage_presign.go lines 352-353 (the
`if scheme == "" { scheme = signed.Scheme }` branch) as untested. The prior
subtest passed "http://..." which set Scheme to "http", missing the
fallback. New subtest uses a protocol-relative "//cdn.instanode.dev" so
url.Parse returns Scheme=="" and the branch fires. signed URL was https,
so the rewritten output must inherit https — pinned.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9cf899c commit 6e3bb87
1 file changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 134 | + | |
| 135 | + | |
139 | 136 | | |
140 | 137 | | |
141 | | - | |
142 | 138 | | |
143 | 139 | | |
144 | 140 | | |
145 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
146 | 155 | | |
0 commit comments