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

Don't rewrite Bing tile URLs to https, instead just ask for https #7861

Merged
merged 1 commit into from
May 28, 2019

Conversation

kring
Copy link
Member

@kring kring commented May 22, 2019

For ~5 years now, we've had code in BingMapsImageryProvider that rewrote the tile URL from http:// to https:// if the page was on an https connection. This seemed kind of dodgy, but we thought it was necessary to avoid mixed content warnings.

But, it turns out that Bing Maps (now?) has a way to directly ask for an https tile URL, by adding &uriScheme=https to the metadata URL. And it also turns out that this is totally necessary with the new "on demand" styles added in #7808 because, if we just rewrite the URL as we were doing before, we get invalid certificate errors. Bing Maps returns an akamai.net certificate when we're connecting on a virtualearth.net domain.

So this PR switches to using the uriScheme mechanism. The new on-demand styles won't work on https pages without this PR (ask me how I know).

Instead, tell Bing what protocol we want.
@cesium-concierge
Copy link

Thanks for the pull request @kring!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@kring
Copy link
Member Author

kring commented May 22, 2019

By the way, I've arranged the logic so that we use useScheme=https for all page protocols except http, which uses uriScheme=http. Specifically file:// URLs and the like will now use https where previously they used http. Arguably we could just use https everywhere, but Bing hasn't changed the default so maybe we shouldn't either I guess.

@kring
Copy link
Member Author

kring commented May 22, 2019

I haven't updated CHANGES.md because this only affects the on-demand styles which haven't been released yet.

@mramato
Copy link
Contributor

mramato commented May 28, 2019

Any reason not to just always use https these days? Otherwise looks good to me. @shunter any thoughts here?

@shunter
Copy link
Contributor

shunter commented May 28, 2019

Bing doesn't use HTTP/2 yet, so HTTPS will have more overhead than HTTP, so that seems like keeping the current default is fine (plus as Kevin says HTTP is Bing's default too)

This works as expected over both HTTP and HTTPS. Merging.

@shunter shunter merged commit a9d3029 into master May 28, 2019
@shunter shunter deleted the bing-https branch May 28, 2019 17:27
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.

4 participants