Various fixes#5742
Merged
Merged
Conversation
…t is HTTPS When EndpointInternal is set to an HTTP URL but the public Endpoint uses HTTPS, PublicOriginMiddleware on the auth server issues a 307 redirect because the request scheme does not match the configured public_origin scheme. The portal HTTP client does not follow redirects, causing the JWKS fetch to fail. Fix by setting X-Forwarded-Proto to the public endpoint's scheme on the internal request, so PublicOriginMiddleware sees the correct scheme and passes the request through without redirecting. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
carmenlau
reviewed
May 28, 2026
| // that the request is already on the correct scheme, suppressing the redirect. | ||
| // This mirrors what a TLS-terminating load balancer does when forwarding to an | ||
| // internal HTTP backend. | ||
| req.Header.Set("X-Forwarded-Proto", parsedEndpoint.Scheme) |
Contributor
There was a problem hiding this comment.
Do we need X-Forwarded-Host for this case?
Contributor
Author
There was a problem hiding this comment.
It is handled in L170 already.
carmenlau
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ref DEV-3616