Fix openapi viewer for relative url instances
Fixes #381047 (comment 1296098032)
What does this MR do and why?
This fixes the openapi
viewer for instances configured with root-relative url.
This has been broken because the iframe sandbox loads on a separate origin which doesn't have access to gon.relative_url_root
to load the webpack chunk properly.
Screenshots or screen recordings
Notice the gdk.test:3000/gitlab
without /gitlab
in the Network URL tab:
before | after |
---|---|
How to set up and validate locally
- Configure a gdk instance by appending the following line to
gdk.yml
relative_url_root: /gitlab
- Run
gdk reconfigure
- Create
openapi.yaml
, for example https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/api/openapi/openapi_v2.yaml
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Dheeraj Joshi