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

Set Access-Control-Allow-Origin headers when running from docker image #10275

Open
CameronGo opened this issue Feb 4, 2025 · 0 comments
Open

Comments

@CameronGo
Copy link

CameronGo commented Feb 4, 2025

Q&A (please complete the following information)

  • Method of installation: docker hub image
  • Swagger-UI version: v5.18.3

Content & configuration

Swagger-UI configuration options:
docker compose file used to run swagger ui

services:
  swagger-ui:
    image: swaggerapi/swagger-ui:v5.18.3
    ports:
      - "8080:8080"
    environment:
      - DEEP_LINKING=true
      - DISPLAY_REQUEST_DURATION=true
      - OAUTH_USE_PKCE=true
      - DOC_EXPANSION=none

How can we help?

When I run swagger-ui from the published docker image, the response headers include Access-Control-Allow-Origin: *. I'd like to set this so that it includes only my API domain name. Is this possible? Every CORS related question I've seen seems to revolve around the openapi.yaml file, not the swagger UI web application itself.

My swagger-ui is running behind the same hostname as my API so I don't really need this header to allow anything for my use case and would just as soon set it to its strictest value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant