-
Notifications
You must be signed in to change notification settings - Fork 4k
🐛 Don't require ampCors for amp-document-recommendations requests #14491
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
🐛 Don't require ampCors for amp-document-recommendations requests #14491
Conversation
3fc6356 to
0c49248
Compare
|
@peterbaran Could you elaborate in the description of this PR what part of #9423 is being addressed? |
|
Oops, linked to the wrong issue. Updated with a link to the specific comment (in the right issue). |
|
@peterjosling On second thought, I think CORS is needed. When in AMP viewer the fetch would originate from a non-origin domain, if they don't setup CORS from the beginning, infinite scroll will fail from AMP cache. I do not recommend merging this PR. |
|
@peterjosling @emarchiori We also need to make sure the fetched AMP page is valid AMP. Maybe we can: |
|
The TODO you have in the code covers the comment above, so LGTM on the PR. |
|
What API is there for getting cache URLs in the runtime? |
|
@honeybadgerdontcare What's the best way to get cache URL of an AMP Url in the runtime? (Context: imagine publishers returning Urls to their AMP pages, we want to make sure they are valid and then ideally inject the SSRed/cached version to the existing document). |
|
@aghassemi I'm not aware of a function in the Runtime that does this. It is provided as an AMP URL API service and the scheme is fairly well defined that it might be possible to add it to the Runtime. |
|
Thanks @honeybadgerdontcare @peterjosling Looks like we can just do this from this extension without adding a core service to runtime. Looks simple enough to do with |
|
Using the API service would presumably require the publisher to create + specify their own API key for it, unless the rate limit is disabled from *.cdn.ampproject.org. Thanks for the link to the scheme! Only issue with transforming it locally is that it looks like there's no code in the framework for doing punycode encoding... |
|
I don't see requirements that Urls need to be converted to punny-code before they are passed as part of the request. I really hope the Url service works with IDL domain names without a need for clients to convert first. (If that's not the case, we can fix the service) Have to defer to @honeybadgerdontcare for rate limit. |
|
It is rate limited. I'll follow up over email with you. |
…ommendations requests (#14491)
Fixes issue described in #12945 (comment)