Commit 0ff1e10
committed
python-ecosys/requests: Make response headers dict lowercase.
The HTTP response headers are case-insensitive. But the old implementation
put them in a dictionary keyed by case-sensitive header name. The only way
to correctly get a header would have been to iterate through the dictionary
looking for it, which is slow and a lot of code and I doubt anyone bothered,
I expect that existing code probably just did a case-sensitive match. That's
fragile, server changes could break it.
To fix that, lowercase all the header names before putting them in the
dictionary. That way, clients can just access the dictionary with the
lowercase header name and it will do the right thing.
This is backward compatible with correctly-written existing code. But it's
not compatible with existing code that was buggy anyway and did a
case-sensitive match.1 parent ca04dd8 commit 0ff1e10
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
| |||
0 commit comments