Documentation for AMP RTC headers incomplete
What's the issue?
I'm working on the AMP RTC test and I've run into a problem with the headers.
How do we reproduce the issue?
Test page: https://rev.cbsi.com/common/test/REVSYS-281/REVSYS-281.amp.html#development=1
Test RTC endpoint: https://cnet.cbsi.com/rtcendpoint.php
The test page is generating the following error: url.js:345 Response must contain the AMP-Access-Control-Allow-Source-Origin header
BUT in the RTC end point has the header AMP-Access-Control-Allow-Source-Origin so I'm unclear why the AMP page is generating an error on this.
The documentation here mentions the headers: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/rtc-publisher-implementation-guide.md
But it does not mention the values for these header. Also in the header section it lists "CORS" as a header but I suspect "CORS" is not an actual header to be added. Lastly, a header of Access-Control-Allow-Credentials: true is also required but not mentioned in the documentation.
Please advise, what is the expected value for the header AMP-Access-Control-Allow-Source-Origin? Are there any other headers (and their values) that I will need to add?
What browsers are affected?
I have only tested this in Chrome.
Which AMP version is affected?
Powered by AMP ⚡ HTML – Version 1510956201635
Per correspondence with Google, The documentation has a typo.
Documentation here lists this:
- Headers (in addition to automatically added headers):
-
- CORS
-
- AMP-Access-Control-Allow-Source-Origin
-
- Access-control-allow-origin
-
- Access-control-expose-header: AMP-Access-Control-Allow-Source-Origin
The last entry should be plural: Access-control-expose-headers: AMP-Access-Control-Allow-Source-Origin
The typo in the documentation should be corrected to avoid others running into the same issue. The requirement for the header Access-Control-Allow-Credentials: true should be added. The listing of "CORS" should be removed or re-worded as that is not a valid header.
Thanks for this, we're looking into it.
Sorry about that mistake, and thanks for bringing it to our attention! We'll get that documentation fixed asap.
Documentation has been updated. Please let us know if anything is missing. Thanks