Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flight route fails to handle route if "%0A%" is presented in the REQUEST_URI #424

Closed
sserg82 opened this issue Aug 24, 2020 · 2 comments
Closed

Comments

@sserg82
Copy link

sserg82 commented Aug 24, 2020

Hello,

I have this route:

Flight::route('/test',function() {
    echo 'test';
});

Flight::route('*',function() {
    echo 'all';
});

if i try to make a request like this:

curl https://test.local/test?key1=%0A%
all

Flight can't see router "/test"

If i try like this:

curl https://test.local/test?key1=%0A
test

everything works fine

@easychen
Copy link

I meet this problem too, it caused by this line of code

https://github.com/mikecao/flight/blob/b3120f8db2ae3b358c1c7a412a92d7aa008a57b4/flight/net/Router.php#L81

I don't know why query string included here, may be it's a bug or just a design.

but you can solve it by change to follow:

$path = parse_url($request->url,PHP_URL_PATH);
$url_decoded = urldecode( $path  );

@n0nag0n
Copy link
Collaborator

n0nag0n commented Jan 11, 2024

I believe I actually fixed this with this commit. c7a143d

@n0nag0n n0nag0n closed this as completed Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants