Commit f53741a
committed
gh-47005: fix do_open() to let regular headers override unredirected headers
AbstractHTTPHandler.do_open() was building the request header dict by
starting with unredirected_hdrs and only inserting regular headers that
were not already present, giving unredirected headers priority. This
contradicts get_header() and header_items(), both of which give regular
headers the higher priority.
Fix by unconditionally updating with req.headers so that a header set
via add_header() always overrides one set via add_unredirected_header().1 parent 36e4ffc commit f53741a
2 files changed
+18
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
983 | 1000 | | |
984 | 1001 | | |
985 | 1002 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1293 | 1293 | | |
1294 | 1294 | | |
1295 | 1295 | | |
1296 | | - | |
1297 | | - | |
| 1296 | + | |
1298 | 1297 | | |
1299 | 1298 | | |
1300 | 1299 | | |
| |||
0 commit comments