Add Swagger UI for API Challenges#64
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e89dc8ae7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private String requestOrigin(final HttpServerRequest request) { | ||
| return "%s://%s".formatted(request.scheme(), request.host()); |
There was a problem hiding this comment.
Preserve the externally visible scheme for OpenAPI servers
When the application is deployed behind an HTTPS-terminating reverse proxy, request.scheme() is the backend connection scheme (normally http), while the browser is on https. This places http://<public-host> first in the generated servers list, so Swagger UI's Try it out requests become mixed-content requests and are blocked by browsers. Derive the public origin from a trusted forwarded-proto configuration/header or retain the configured HTTPS server instead.
Useful? React with 👍 / 👎.
Summary
Validation
mvn -pl challenger -am -Dtest=UiPagesAreReachableTest -DfailIfNoTests=false testmvn -pl thingifier -DskipTests checkstyle:check@project-fqn-checkmvn spotless:checkmvn -pl challenger -am -DskipTests packageCloses #61