Skip to content

Incorrect routing for requests without leading slash #21967

Closed
@syzygymsu

Description

@syzygymsu
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version all

HTTP requests without leading "/" (e.g. GET ?a=b ...) are not routed to index controller (one with path="/").

How to reproduce:
Create a new Symfony project and configure it to run under a root of any hostname (let it be http://localhost/).
Do not use a browser because majority of them do not produce requests like the one in question. Instead use telnet:

telnet localhost 80
> GET ?a=b HTTP/1.1
> Host: localhost
>

Expected output: welcome page (same as for GET /?a=b ...).
Actual output: "404 Not Found" page.

Reproduced with latest versions of v2.8 and v3.2 but other releases should be affected too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions