-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Conversation
@jas- You got a commit that does not belong here |
@macnibblet Whoops, thanks! |
Added FQDN as Origin string per RFC @ http://tools.ietf.org/id/draft-abarth-origin-03.html#rfc.section.2 for test case
@jas- seems like you create your branch based on this PR #5008 if that is the case the easiest way i see to correct it is create a new branch based on master and copy the new two files to that branch and edit the other file again. Or merge or rebase your branch with an updated version of master (Since the PR has already been acepted) |
…d\Uri\UriFactory' method of validation
throw new Exception\InvalidArgumentException('Invalid header line for Origin string: "' . $name . '"'); | ||
} | ||
|
||
if (!filter_var($value, FILTER_VALIDATE_URL)) { |
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.
The problem with filter_var is that it will return false for "example.com". iirc I've seen many CORS requests where the Origin is not using the schema.
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.
According to the ietf working draft the UA behavior should be conforming to RFC 3986 regarding the proper URI format which (without more testing on my own) this doc seems to support your claim. Are you aware of a sure fire RFC 3986 regex to take its place? I will have to test this a bit but I found one that seems to conform on stack overflow
preg_match(/^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/, $value)
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.
What about using Zend\Uri validator ?
@@ -56,6 +56,7 @@ class HeaderLoader extends PluginClassLoader | |||
'lastmodified' => 'Zend\Http\Header\LastModified', | |||
'location' => 'Zend\Http\Header\Location', | |||
'maxforwards' => 'Zend\Http\Header\MaxForwards', | |||
'Origin' => 'Zend\Http\Header\Origin', |
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.
lowercase keys here are necessary. I can do that on merge, though.
Support for Origin header
- lowercase "origin" in plugin loader - remove unnecessary lines in test class
Merged to develop for release with 2.3.0. |
@weierophinney Thanks! |
…efixed-with-global-ns' Close zendframework/zendframework#5029
…efixed-with-global-ns' into develop Close zendframework/zendframework#5029 Forward Port zendframework/zendframework#5029
…efixed-with-global-ns' Close zendframework/zendframework#5029
…efixed-with-global-ns' into develop Close zendframework/zendframework#5029 Forward Port zendframework/zendframework#5029
…efixed-with-global-ns' Close zendframework/zendframework#5029
…efixed-with-global-ns' into develop Close zendframework/zendframework#5029 Forward Port zendframework/zendframework#5029
…efixed-with-global-ns' Close zendframework/zendframework#5029
…efixed-with-global-ns' into develop Close zendframework/zendframework#5029 Forward Port zendframework/zendframework#5029
…efixed-with-global-ns' Close zendframework/zendframework#5029
…efixed-with-global-ns' into develop Close zendframework/zendframework#5029 Forward Port zendframework/zendframework#5029
Support for Origin header
- lowercase "origin" in plugin loader - remove unnecessary lines in test class
…efixed-with-global-ns' Close zendframework/zendframework#5029
…efixed-with-global-ns' into develop Close zendframework/zendframework#5029 Forward Port zendframework/zendframework#5029
…efixed-with-global-ns' Close zendframework/zendframework#5029
…efixed-with-global-ns' into develop Close zendframework/zendframework#5029 Forward Port zendframework/zendframework#5029
Per issue #5025 discussed with @weierophinney. Please let me know if I missed a step as I followed the contributing guide.