Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 amp-ad: fixed URL handling on uzou.js #20342

Merged
merged 4 commits into from Jan 18, 2019

Conversation

send
Copy link
Contributor

@send send commented Jan 15, 2019

We have fixed URL handling on uzou.js for our ad network.

  • Use sourceUrl instead of canonicalUrl
  • fix akamaiHost to use data-widget-params

Could you review our commits?

Regards.

@send send changed the title 馃悰 amp-ad: fixed URL handling on uzou.js 馃悰 amp-ad: fixed URL handling on uzou.js Jan 15, 2019
@yoppi
Copy link
Contributor

yoppi commented Jan 16, 2019

@lannka Please check for travis. Maybe occurred timeout error...

@mrjoro
Copy link
Member

mrjoro commented Jan 16, 2019

/cc @ampproject/wg-monetization

Copy link
Contributor

@zhouyx zhouyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one comment

@@ -33,6 +32,7 @@ export function uzou(global, data) {
};

const widgetParams = parseJson(data['widgetParams']);
const akamaiHost = widgetParams['akamaiHost'] || 'speee-ad.akamaized.net';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually ask the contributor to wrap url params with #encodeURIComponent(), but since it is the host, I believe you won't want that. @send to confirm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And simply to make sure the new change is documented your side.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only use akamaiHost param for debugging purpose. And this param is the host part of ad script url. So we don't need wrap this one.
However, uzoInjector.url is expected encoding based on RFC 3986. So we have fixed it.

@zhouyx zhouyx merged commit e4f965c into ampproject:master Jan 18, 2019
@zhouyx
Copy link
Contributor

zhouyx commented Jan 18, 2019

LGTM. Merged.

@send
Copy link
Contributor Author

send commented Jan 18, 2019

thanks !

noranazmy pushed a commit to noranazmy/amphtml that referenced this pull request Mar 22, 2019
* fixed urls

* fixed URI encoding

* using rfc3986

* fixed lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants