This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Commit a273be6
authored
Fix fragment handling in HttpClient (#27360)
* Fix fragment handling in HttpClient
SocketsHttpHandler isn't sending fragments, nor is it properly inheriting the fragment from the original request URI into the redirect location URI when the original URI had one and the redirect URI did not, even though RFC 7231 says it must. This commit fixes that for SocketsHttpHandler.
WinHttpHandler also isn't handling this inheritance according to the RFC. It appears that the logic for WinHttpHandler would actually need to be changed in WINHTTP itself, or else WinHttpHandler would need to be changed to do the redirects itself.
Neither CurlHandler or NetFxHandler send fragments at all.
This commit also fixes the test to correctly compare the expected and actual Uris... apparently Uri equality doesn't factor in fragments, so they're first converted to strings. It also updates the test to also validate that the server received the URI with the fragment included.
* Disable the fragments test on WinHttpHandler
Apparently it sometimes doesn't do the "right thing" even in other cases.1 parent 3de3cd7 commit a273be6
File tree
3 files changed
+61
-11
lines changed- src/System.Net.Http
- src/System/Net/Http/SocketsHttpHandler
- tests/FunctionalTests
3 files changed
+61
-11
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
89 | 102 | | |
90 | 103 | | |
91 | 104 | | |
92 | 105 | | |
93 | 106 | | |
94 | | - | |
| 107 | + | |
95 | 108 | | |
96 | 109 | | |
97 | 110 | | |
| |||
Lines changed: 46 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
915 | | - | |
| 915 | + | |
916 | 916 | | |
917 | 917 | | |
918 | 918 | | |
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
922 | | - | |
923 | 922 | | |
924 | 923 | | |
925 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
926 | 952 | | |
927 | 953 | | |
928 | 954 | | |
929 | 955 | | |
930 | 956 | | |
931 | 957 | | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
937 | 965 | | |
| 966 | + | |
938 | 967 | | |
939 | 968 | | |
940 | 969 | | |
941 | 970 | | |
942 | | - | |
| 971 | + | |
| 972 | + | |
943 | 973 | | |
944 | 974 | | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
945 | 982 | | |
946 | 983 | | |
947 | 984 | | |
948 | | - | |
| 985 | + | |
949 | 986 | | |
950 | 987 | | |
951 | 988 | | |
| |||
0 commit comments