-
Notifications
You must be signed in to change notification settings - Fork 187
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
withRequestTarget() accepts string only #78
Conversation
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.
👍
Anyone..? |
Requires an errata vote. One reason why it allows non-strings is to potentially allow passing a As such, narrowing the scope has the potential to break existing implementations and/or consumers. |
@weierophinney |
perfect good post |
I'm doing my own implementation of "RequestInterface" and am in doubt about how the "withRequestTarget" and "withUri" methods should work relative to their respective values since: If I use "withRequestTarget" passing as an argument a value that is totally different from the information that is contained in the respective "uri" object (especially with regards to the results of the "getPath" and "getQuery" methods) will result in a new "RequestInterface" instance where these values do not match. Is this supposed to be the case? I know that the "requestTarget" is more complex than the simple join of "getPath" and "getQuery" but I would like to resolve this question in particular because I noticed that implementation made by the slim framework (https://github.com/slimphp/Slim-Http/blob/master/src/Request.php) uses the "getPath" and "getQuery" methods to form the "requestTarget" value, which seems to me to be a direct correlation between these values and I think that perhaps this correlation is at some level necessary for the purposes of the classes that implement the "RequestInterface" |
@AeonDigital Please do not hijack an existing pull request to ask unrelated questions. To answer you, however: if a request target is provided to the request instance, that value should be used instead of the composed If no request target is set, then the default, per RFC 7230 section 2.7 is to use origin-form, which is the path + query parameters (if any exist). |
This issue is resolved by #94. |
@weierophinney Good! I can see that it has finally been restricted to |
@BenMorel Correct. The spec uses RFC 7230 as a guide here, and the |
As far as I can see,
withRequestTarget()
only accepts astring
.