-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Using extraUrlParams breaks expansion for requests #2245
Comments
looking into it... |
The request sent is |
Thanks @avimehta! |
@cory-work Found the cause for the bug and will be sending out a fix soon. For now, Do you mind moving the host to requests section? So something like this:
|
@avimehta Just took a closer look... It looks like the definition of |
The issue occurs in this line. When the extraUrlParams are present, the request is parsed and additional parameters are added back to the request. During the parsing of the request, browser encodes I am not sure what the right fix here is.
|
I think the third solution seems like the best path. I'd dismiss (1) because, unlike what I thought earlier, this only breaks with the addition of extraUrlParams, so if the vars are correctly added when not in the presence of extraUrlParams, I think they should also be correct added when extraUrlParams is present. I'd dismiss (2) because it seems useful to allow extraUrlParams to be defined with substitutions. It seems like this just looks like an order of operations thing and hence why path (3) is best, but let me know if there's another way to look at the tradeoffs. |
With this change, the other parts of URL are not touched when appending to the query parameters. Fixes ampproject#2245
I came to this page with what I believe to be the same problem. Just posting it here because I'd like to make sure this case is addressed in the fix:
|
Yes, I believe it does. https://github.com/ampproject/amphtml/pull/2543/files#diff-a4664cb4c01931444a010c4d5ea1df63R330 tests the case where vars are used inside path. Checking locally again. |
confirmed. the example from #2245 (comment) results in following request to be sent:
|
Thank you! |
The the extraUrlParams are added to a request the request gets parsed as a URL. When this happens any variables in the host part of the request are url encoded which breaks the variable expansion. Below is an example of an amp-analytics tag that breaks in chrome.
The text was updated successfully, but these errors were encountered: