Commit 428856f
committed
config: make isCrossHostRedirect sticky across the redirect chain
Walk every hop in the redirect chain rather than only checking the
current request's host. Once any hop leaves the original host, the
function returns true for all subsequent requests in that chain, even
if a later hop redirects back to the original host.
This mirrors net/http's own behaviour and closes the bypass window
where a cross→original→cross chain could slip credentials through.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>1 parent 0d8de87 commit 428856f
2 files changed
Lines changed: 67 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1117 | 1117 | | |
1118 | 1118 | | |
1119 | 1119 | | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
1124 | 1130 | | |
1125 | 1131 | | |
1126 | 1132 | | |
1127 | 1133 | | |
1128 | 1134 | | |
1129 | 1135 | | |
1130 | 1136 | | |
1131 | | - | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
1132 | 1143 | | |
1133 | 1144 | | |
1134 | 1145 | | |
| |||
1140 | 1151 | | |
1141 | 1152 | | |
1142 | 1153 | | |
1143 | | - | |
1144 | | - | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1145 | 1158 | | |
1146 | 1159 | | |
1147 | 1160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1515 | 1515 | | |
1516 | 1516 | | |
1517 | 1517 | | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
1518 | 1565 | | |
1519 | 1566 | | |
1520 | 1567 | | |
| |||
0 commit comments