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

Enhancement: Respect scheme from the serverName listener property in redirect URLs #25044

Merged

Conversation

OndroMih
Copy link
Contributor

@OndroMih OndroMih commented Jul 12, 2024

ServerName property on the HTTP listener can contain scheme prefix (e.g. https://), which will be respected in redirects created by GlassFish.

For example, if GlassFish is behind a proxy server, connections to the proxy server go through HTTPS but connections from proxy server to GlassFish go through HTTP. If the proxy server is exposed at https://my.domain.com, then it's possible to set the serverName to https://my.domain.com:443 to use https://my.domain.com/ in redirects. This URL doesn't have to be translated by the proxy server because it's the correct URL where the proxy server listens to incoming requests.

This resolves #24918.

* The HTTP scheme to which we should pretend requests to this Connector were directed. This is useful when operating
* GlassFish behind a proxy server, so that redirects get constructed accurately.
*/
private String proxyScheme = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's extremely minor, but null is already the default and can be left out.

@arjantijms arjantijms merged commit 3736639 into eclipse-ee4j:master Jul 15, 2024
2 checks passed
@dmatej dmatej added this to the 7.0.16 milestone Jul 15, 2024
@dmatej dmatej added the enhancement New feature or request label Jul 15, 2024
@OndroMih OndroMih deleted the ondromih-gh24918-proxy-scheme branch July 17, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Allow to specify protocol for URLs the server sends to the client
3 participants