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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually enforce what error message says: Protocol relative only allowed when container is HTTPS. #2029

Merged
merged 1 commit into from
Feb 16, 2016

Conversation

cramforce
Copy link
Member

Fixes #2027

* @return {string}
*/
export function assertHttpsUrl(urlString, elementContext) {
export function assertHttpsUrl(urlString, elementContext, opt_win) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Will we actually ever supply opt_win? It seems a bit odd, given that all URLs are resolved against the current window in the line above parseUrl(urlString). Or is it only for tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Its only for tests. But your comment is correct. This was wrong in different way from what I thought.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you thinking about changing this? You could also rename it to opt_winForTestOnly or something like that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll need to do something entirely different for this change :)

@cramforce
Copy link
Member Author

PTAL. New fix just deletes a line.

@dvoytenko
Copy link
Contributor

LGTM

cramforce added a commit that referenced this pull request Feb 16, 2016
Actually enforce what error message says: Protocol relative only allowed when container is HTTPS.
@cramforce cramforce merged commit de7c148 into ampproject:master Feb 16, 2016
@cramforce cramforce deleted the https-check branch February 16, 2016 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants