-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Support for 'origin' header value? #5025
Comments
@jas- this shouldn't land in the base MVC imo. @Orkin is working on https://github.com/zf-fr/zfr-cors for this, which is a better place where to handle these REST-specific problems. |
@jas The feature will be merge propably since end of this week ;) |
In most cases the Origin header is not sent by the browser, So that is most likely the reason you cannot see the origin header. But in general Zf2 will never hide any information from the user so if you cannot see the origin header in the |
@jas- sorry, didn't understand the original question, my bad :) Forget about the CORS stuff, it's unrelated |
@macnibblet Strange... here are the headers during the request:
And here is the contents of the request as seen from
|
@jas- What happens if you remove all the logic from your index.php and replace it with a simple |
@macnibblet Here are some results, as you can see using the Results of
Results of
And the raw
A quick grep of the |
@jas- Perhaps we should change |
@weierophinney Wouldn't it best be suited as a plugin since Perhaps adding to the other static plugins for available header key/value pairs as defined in |
@weierophinney |
@weierophinney I have opened a pull request for this. The support has been added to the 'Zend\Http\Headers' namespace. Even though the current status of the RFC is a draft and in anticipation that it will 'hopefully' will be added to the current RFC-2616 header field specification. |
Closed with #5029. |
Perhaps I am missing something but the protected array of headers returned with the commonly used
Zend\Http\Headers::getHeaders()
call does not seem to include the 'origin' header key/value pair.Is this by design? I would think this header would be exposed to the
Zend\Mvc\Controller\AbstractRestfulController
in order to protect a RestFul API with a whitelist of allowed applications based on this header value duringOPTIONS
request types.Any insight is appreciated as I very well may be doing something wrong or using the wrong method of accessing this key during requests. Thanks
The text was updated successfully, but these errors were encountered: