Skip to content

Draft: Allow same origin for OpenAPI viewer

What does this MR do and why?

This MR address an issue where the Origin header is set to null, which causes CORS issues. Right now it's not possible to use the "Try it out" feature in the GitLab OpenAPI viewer as the API server is receiving null as the origin.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

This screen recording shows the issue before and after the change.

GitLab_Screen_Recording

How to set up and validate locally

See screen recording to see these steps in action.

  1. Open any OpenAPI spec in a repository.
  2. Open the browser Developer tools/Web Inspector, select the network tab and choose "Clear Network Items"
  3. Click on one of the endpoints in the rendered documentation view and choose "Try it out" and then "Execute"
  4. You should see a successful response in the UI and also in the Developer tools/Web Inspector

Related to #431175

Edited by austen-herbst

Merge request reports