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

Support HTTP 405 response code #174

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Support HTTP 405 response code #174

wants to merge 4 commits into from

Conversation

jtojnar
Copy link

@jtojnar jtojnar commented Jan 17, 2022

This will allow us to have code like this:

$router->set404(function($handledByOtherMethod) {
    if ($handledByOtherMethod) {
        header('HTTP/1.1 405 Method Not Allowed');
    } else {
        header('HTTP/1.1 404 Not Found');
    }
    // ... do something special here
});

This would make `RouterTest::testArrayMatch` fail with:

	Undefined array key "PUT"

	src/Bramus/Router/Router.php:298
	tests/RouterTest.php:242
	vendor/bin/phpunit:110
@jtojnar jtojnar force-pushed the 405 branch 2 times, most recently from 5e478cc to 6d9ae78 Compare January 18, 2022 02:58
@oskarniziol
Copy link

Good idea!

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

Successfully merging this pull request may close these issues.

2 participants