Commit 93b49c5
committed
py3: Be able to parse non-RFC-compliant request lines
There's a bug in CPython [1] that causes servers to mis-parse request
lines that include the bytes \x85 or \xa0. Naturally, we have
functional tests that (with high probability) will send such request
lines. There's a fix proposed, but the earliest it's likely to land
would be for 3.8, and we need to be able to target an earlier Python.
So, intercept the request line immediately before parsing and re-write
it to be RFC-compliant. Note that this is done for Python 2 as well,
though there should be no change in the request environment that
eventlet eventually hands to us.
[1] https://bugs.python.org/issue33973
Change-Id: Ie648f5c04d4415f3b620fb196fa567ce7575d5221 parent f55167a commit 93b49c5Copy full SHA for 93b49c5
2 files changed
+60-7Lines changed: 60 additions & 7 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- swift/common
- test/unit/common
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+32-1Lines changed: 32 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
35 | 35 | |
36 | 36 | |
37 | 37 | |
38 | | - |
| 38 | + |
| 39 | + |
39 | 40 | |
40 | 41 | |
41 | 42 | |
| ||
433 | 434 | |
434 | 435 | |
435 | 436 | |
| 437 | + |
| 438 | + |
| 439 | + |
| 440 | + |
| 441 | + |
| 442 | + |
| 443 | + |
| 444 | + |
| 445 | + |
| 446 | + |
| 447 | + |
| 448 | + |
| 449 | + |
| 450 | + |
| 451 | + |
| 452 | + |
| 453 | + |
| 454 | + |
| 455 | + |
| 456 | + |
| 457 | + |
| 458 | + |
| 459 | + |
| 460 | + |
| 461 | + |
| 462 | + |
| 463 | + |
| 464 | + |
| 465 | + |
| 466 | + |
436 | 467 | |
437 | 468 | |
438 | 469 | |
|
Collapse file
test/unit/common/test_wsgi.py
Copy file name to clipboardExpand all lines: test/unit/common/test_wsgi.py+28-6Lines changed: 28 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
27 | 27 | |
28 | 28 | |
29 | 29 | |
| 30 | + |
30 | 31 | |
31 | 32 | |
32 | 33 | |
| ||
984 | 985 | |
985 | 986 | |
986 | 987 | |
987 | | - |
988 | | - |
989 | | - |
990 | | - |
991 | | - |
992 | 988 | |
993 | 989 | |
994 | 990 | |
| ||
1041 | 1037 | |
1042 | 1038 | |
1043 | 1039 | |
1044 | | - |
1045 | 1040 | |
1046 | 1041 | |
1047 | 1042 | |
1048 | 1043 | |
1049 | 1044 | |
| 1045 | + |
| 1046 | + |
| 1047 | + |
| 1048 | + |
| 1049 | + |
| 1050 | + |
| 1051 | + |
| 1052 | + |
| 1053 | + |
| 1054 | + |
| 1055 | + |
| 1056 | + |
| 1057 | + |
| 1058 | + |
| 1059 | + |
| 1060 | + |
| 1061 | + |
| 1062 | + |
| 1063 | + |
| 1064 | + |
| 1065 | + |
| 1066 | + |
| 1067 | + |
| 1068 | + |
| 1069 | + |
| 1070 | + |
| 1071 | + |
1050 | 1072 | |
1051 | 1073 | |
1052 | 1074 | |
|
0 commit comments