-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Empty PATH_INFO is (probably) invalid and will (probably) fail in Rack 3.2. #2113
Copy link
Copy link
Open
Labels
Description
See rack/rack#2316 and rack/rack#2307 for background.
These two tests use an empty PATH_INFO which is basically invalid:
Lines 248 to 276 in 5e15985
| it 'matches empty PATH_INFO to "/" if no route is defined for ""' do | |
| mock_app do | |
| get '/' do | |
| 'worked' | |
| end | |
| end | |
| get '/', {}, "PATH_INFO" => "" | |
| assert ok? | |
| assert_equal 'worked', body | |
| end | |
| it 'matches empty PATH_INFO to "" if a route is defined for ""' do | |
| mock_app do | |
| disable :protection | |
| get '/' do | |
| 'did not work' | |
| end | |
| get '' do | |
| 'worked' | |
| end | |
| end | |
| get '/', {}, "PATH_INFO" => "" | |
| assert ok? | |
| assert_equal 'worked', body | |
| end |
A web server request must always begin with a / character, e.g.
GET / HTTP/1.0
...
There is no way that the PATH_INFO can be an empty string.
Reactions are currently unavailable