This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 195
Forwarded method flag in head request #480
Closed
snapshotpl
wants to merge
4
commits into
zendframework:master
from
snapshotpl:forwarded_method_in_head_request
Closed
Forwarded method flag in head request #480
snapshotpl
wants to merge
4
commits into
zendframework:master
from
snapshotpl:forwarded_method_in_head_request
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
suggested changes
Oct 9, 2017
$request->withMethod(RequestMethod::METHOD_GET) | ||
$request | ||
->withMethod(RequestMethod::METHOD_GET) | ||
->withAttribute('forwarded_http_method', RequestMethod::METHOD_HEAD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a constant for this attribute name, please, and then update the code to use that constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And, on second thought: shouldn't this be accomplished with either an X-Forwarded-Proto
or Forwarded
header (see the MDN docs)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This headers should be using in specified cases but not to forward http methods.
weierophinney
added a commit
that referenced
this pull request
Dec 11, 2017
Forwarded method flag in head request
weierophinney
added a commit
that referenced
this pull request
Dec 11, 2017
weierophinney
added a commit
that referenced
this pull request
Dec 11, 2017
weierophinney
added a commit
that referenced
this pull request
Dec 11, 2017
Thanks, @snapshotpl |
Merged to develop for release with 2.1.0. |
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.
ImplicitHeadMiddleware
clears body, but we now we are not able to detect that is a HEAD request in final middleware.forwarded_http_method
can be use to abandon prepare response body