Bing Maps CORP

Scott Fredrickson 1 Reputation point
2022-06-06T22:56:37.603+00:00

After enabling COEP and COOP on my server, Bing Maps no longer function as the response is missing appropriate HTTP Headers.

The following is seen in the Firefox browser console:

The resource at “https://www.bing.com/api/maps/mapcontrol?callback=initMapBing&key=[REDACTED]” was blocked due to its Cross-Origin-Resource-Policy header (or lack thereof). See https://developer.mozilla.org/docs/Web/HTTP/Cross-Origin_Resource_Policy_(CORP)

Documentation seems to indicate that bing.com would need to add the following HTTP Headers to that response:

access-control-allow-origin: *
cross-origin-resource-policy: cross-origin

My server includes the following on the page including the map:
cross-origin-embedder-policy: require-corp
cross-origin-opener-policy: same-origin

Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
257 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. IoTGirl 3,206 Reputation points Microsoft Employee
    2023-06-16T05:38:53.1166667+00:00

    Hi Scott,

    Have you written an App or are you talking about the Bing.com/maps website?

    The CORS issue is usually because you are trying to access a service that is on a different domain. If you trace the error, do you find a domain mismatch? If you call https://sdk,virtualearth.net/api/maps/mapcontrol as documented at https://learn.microsoft.com/en-us/bingmaps/v8-web-control/creating-and-hosting-map-controls/creating-a-basic-map-control does the issue resolve?

    Sincerely,

    IoTGirl

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.