This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix #6385 Request exception #6409
Closed
stefanotorresi
wants to merge
6
commits into
zendframework:master
from
stefanotorresi:fix-6385-request-exception
Closed
Fix #6385 Request exception #6409
stefanotorresi
wants to merge
6
commits into
zendframework:master
from
stefanotorresi:fix-6385-request-exception
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@weierophinney can you review this PR? Thanks. |
I'm actually merging this, as I don't see a reason why a request couldn't have a custom HTTP method. |
Ocramius
added a commit
that referenced
this pull request
Aug 6, 2014
Ocramius
added a commit
that referenced
this pull request
Aug 6, 2014
Rebased and manually merged into |
This is supposed to be closed, wasn't automatically done by the commit. |
freax
pushed a commit
to freax/zf2
that referenced
this pull request
Nov 27, 2014
gianarb
pushed a commit
to zendframework/zend-http
that referenced
this pull request
May 15, 2015
…tion when not needed
gianarb
pushed a commit
to zendframework/zend-http
that referenced
this pull request
May 15, 2015
…rk/zf2#6385-allow-custom-http-methods' into develop Close zendframework/zendframework#6409
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this PR fixes #6385 .
The idea suggested by @weierophinney is to loosen the strictness of
Zend\Http\Request
to get rid of the uncaught exception, and then add an event listener to the mvc cycle to give users some flexibility and feedback (that will be done in a different PR againstdevelop
).There is a catch that I leave for discussion, tho.
Personally, I can't see any reason why one would want to have
Application::construct()
trigger a fatal error if a bogus http method was set in the server environment, but - although unlikely - it's possible that people could rely on the exceptions thrown byRequest::setMethod()
andRequest::fromString()
when usingZend\Http
component alone. One example isZend\Http\Client
itself, as shown in this PR.It may be worth mentioning that this behaviour wasn't covered by the
Request
tests themselves, but it was inClient
ones. Overall I'd say dropping some strictness seems legit, but I can see why it may be undesirable.As an alternative, it's totally possible to set the flag strict by default, and open it up in
Zend\Mvc\Service\RequestFactory
instead. That could preserve the old behaviour ofZend\Http
component and at the same time makeApplication
behaviour more sane.