-
Notifications
You must be signed in to change notification settings - Fork 25
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
CORS requirements can be misread #192
Comments
Thanks for the follow up. I agree with your assessment of the specs.
Without naming names, are you aware of controllers that expect these headers, not just the testing tool (previous to the fix by AMWA-TV/nmos-testing#724)? |
Admittedly the testing tool is the only client I'm aware of that is explicitly checking for CORS headers. I am aware of a commercially available controller that is developed on top of .NET / ASP.NET and always sends CORS server headers based on their interpretation of the current specification (and likely previous testing tool behaviour). As mentioned previously I know from experience that is not default behaviour for the framework, and so the developers would have had to go though some hoops to override that. |
Architecture Review Group review: place on backlog |
This is a follow up to a conversation in an issue logged with the NMOS API Testing Tool (AMWA-TV/nmos-testing#722).
Currently the Server Side Implementation Notes state that "all NMOS APIs MUST implement valid CORS HTTP headers in responses to all requests". As currently worded this can be interpereted to mean that all APIs must always send CORS headers, regardless of whether or not the client is making a cross origin request that requires CORS headers.
However the Fetch specification, which specifies CORS, only requires servers to send CORS headers if the client is making a cross origin request and participating in the CORS protocol. This is indicated by the client sending an
Origin
header, or in the case of a preflight request anAccess-Control-Request-Method
header.I expect the intention here was not for NMOS API servers to respond with CORS headers at all times, but rather for servers to respond with the appropriate CORS headers to allow a cross origin request when the client makes a CORS request as per the Fetch specification. As such the NMOS specifications should be reworded to clarify this.
The issue with the current wording is some NMOS client implementations expect server to always send CORS headers. However some servers and development frameworks (e.g. ASP.NET) by default only send CORS headers when they receive an appropriate header (e.g.
Origin
) in the request from the client, which is valid behaviour per the Fetch specification.The text was updated successfully, but these errors were encountered: