Repository navigation
Commit 252dbaa
authored
Remove dot segments from absolute redirect locations (#2648)
resolve_relative_location removed "." and ".." segments only from a relative-path Location. A Location that starts with "/" or an absolute URI was requested as is, so a redirect to /dir/../target went out as /dir/../target and a server that does not normalize the path answered 404.
RFC 3986 section 5.2.2 applies remove_dot_segments to the target path of every reference that has a path, and Go and urllib3 do the same. The loop now lives in detail::remove_dot_segments, and ClientImpl::redirect applies it to an absolute path as well. Relative locations resolve as before.1 parent 8710fbd commit 252dbaa
2 files changed
Lines changed: 75 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
995 | 995 | | |
996 | 996 | | |
997 | 997 | | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
998 | 1022 | | |
999 | 1023 | | |
1000 | 1024 | | |
| |||
1015 | 1039 | | |
1016 | 1040 | | |
1017 | 1041 | | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
| 1042 | + | |
| 1043 | + | |
1038 | 1044 | | |
1039 | 1045 | | |
1040 | 1046 | | |
| |||
16405 | 16411 | | |
16406 | 16412 | | |
16407 | 16413 | | |
| 16414 | + | |
| 16415 | + | |
| 16416 | + | |
| 16417 | + | |
16408 | 16418 | | |
16409 | 16419 | | |
16410 | 16420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20593 | 20593 | | |
20594 | 20594 | | |
20595 | 20595 | | |
| 20596 | + | |
| 20597 | + | |
| 20598 | + | |
| 20599 | + | |
| 20600 | + | |
| 20601 | + | |
| 20602 | + | |
| 20603 | + | |
| 20604 | + | |
| 20605 | + | |
| 20606 | + | |
| 20607 | + | |
| 20608 | + | |
| 20609 | + | |
| 20610 | + | |
| 20611 | + | |
| 20612 | + | |
| 20613 | + | |
| 20614 | + | |
| 20615 | + | |
| 20616 | + | |
| 20617 | + | |
| 20618 | + | |
| 20619 | + | |
| 20620 | + | |
| 20621 | + | |
| 20622 | + | |
| 20623 | + | |
| 20624 | + | |
| 20625 | + | |
| 20626 | + | |
| 20627 | + | |
| 20628 | + | |
| 20629 | + | |
| 20630 | + | |
| 20631 | + | |
| 20632 | + | |
| 20633 | + | |
| 20634 | + | |
| 20635 | + | |
| 20636 | + | |
| 20637 | + | |
| 20638 | + | |
| 20639 | + | |
| 20640 | + | |
20596 | 20641 | | |
20597 | 20642 | | |
20598 | 20643 | | |
| |||
0 commit comments