Azure / api-management-developer-portal

Developer portal provided by the Azure API Management service.
MIT License
479 stars 306 forks source link

Custom widget can not call developer portal backend - Origin null is not allowed by Access-Control-Allow-Origin #2364

Closed heller-tobias closed 5 months ago

heller-tobias commented 5 months ago

Bug description

The issue arises when calling the developer portal backend through a custom widget using the endpoint /developer/apis/API_NAME?export=true&api-version=2022-04-01-preview. While this operation functions correctly on Google Chrome, Safari users encounter a Cross-Origin Resource Sharing (CORS) error. It's essential to investigate and address this discrepancy, specifically within the context of the custom widget, to ensure proper functionality across both browsers.

Reproduction steps

  1. Create a custom widget where you call the endpoint GET /developer/apis/API_NAME?export=true&api-version=2022-04-01-preview
  2. Deploy this widget to the developer portal and embed it on the page
  3. Go to the page with the widget on Safari and open the Developer Tools
  4. See console error: support_request

Expected behavior

The backend should return data also for Safari.

Is your portal managed or self-hosted?

Managed

API Management service name

[e.g., apim-GaasDev-devportal-testing]

Environment

Additional context

joahuber commented 5 months ago

We face the same issue.

RickOttenNS commented 5 months ago

We also face the same issue, but not just in safari. In Chrome as well, the custom html widget fails to set an origin, resulting in CORS issues.

malincrist commented 5 months ago

Hello, thanks for reaching out! We have already addressed this issue, and it will be shipped with the next release (2.26).