Commit af1076d
committed
fix: avoid mutating redirect chain array when formatting
toStringDetailed() and toJSONDetailed() call .reverse() on the array
returned by request.redirectChain(), which mutates the original array
in-place. Subsequent calls to these methods or any code that reads the
redirect chain will see the reversed (incorrect) order.
Copy the array before reversing to avoid mutating shared state.1 parent 8d765c0 commit af1076d
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
0 commit comments