Repository navigation
🐛 enforce https in requestForBatchFetch for SSR fetch paths - #40562
Open
mrdevel2002-ui wants to merge 2 commits into
Open
mrdevel2002-ui wants to merge 2 commits into
mrdevel2002-ui wants to merge 2 commits into
Conversation
batchFetchJsonFor asserted assertHttpsUrl on the fetch URL but the shared requestForBatchFetch helper did not, so the amp-list and amp-autocomplete SSR paths that call it directly fetched a non-https src that the inline path rejects. Move the check into requestForBatchFetch so every fetch path enforces it.
Throwing synchronously escaped amp-list's fetchList_ error handling on the SSR path and broke the amp-state:/amp-script: SSR unit tests. Keep the original synchronous check in batchFetchJsonFor.
Author
|
Pushed a fix for the All Unit Tests failure. The https check in requestForBatchFetch now rejects the returned promise instead of throwing, so amp-list's SSR path hands it to its normal fetch-error handling. batchFetchJsonFor keeps its original synchronous assert. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
batchFetchJsonForassertsassertHttpsUrlon the fetch URL, but the sharedrequestForBatchFetchhelper does not, and amp-list (ssrTemplate_) and amp-autocomplete (getRemoteData_) call it directly on their viewer/SSR path. In SSR mode a non-httpssrcis then built into a credentialed request and handed to the viewer to fetch, while the inline (non-SSR) path rejects it. Moving the check intorequestForBatchFetchcloses that gap for both SSR callers.Added a regression test in
test-batched-json.jsthat exercisesrequestForBatchFetchdirectly.