Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Forwarded method flag in head request #480

Conversation

snapshotpl
Copy link
Contributor

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

$request->withMethod(RequestMethod::METHOD_GET)
$request
->withMethod(RequestMethod::METHOD_GET)
->withAttribute('forwarded_http_method', RequestMethod::METHOD_HEAD)
Copy link
Member

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.

Copy link
Member

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)?

Copy link
Contributor Author

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 weierophinney modified the milestones: 2.1.0, 2.2.0 Oct 9, 2017
@weierophinney weierophinney modified the milestones: 2.2.0, 2.1.0 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
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
@weierophinney
Copy link
Member

Thanks, @snapshotpl

@weierophinney
Copy link
Member

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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants