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

[gateway] Enable requests to internal endpoints to override the Host header #644

Closed
Yaytay opened this Issue Jun 15, 2017 · 0 comments

Comments

Projects
None yet
3 participants
@Yaytay

Yaytay commented Jun 15, 2017

Expected Behavior

When a request is made to the backend service it should be possible to override the host header to that the service.

Current Behavior

At the moment the Host header is explicitly set at VertxHttpClient.java:173, taking its value from the backend service URL at VertxHttpClient.java:125 as

(port == 80 || port == 443) ? uri.getHost() : uri.getHost() + ':' + port

Possible Solution

Create a new option at the API (or Endpoint) level of "Override Host header".
If this value is set use its value instead of the current logic, if it isn't set use the current logic.

Context

We are trying to use KeyCloak behind Gravitee and whilst it has explicit support for X-Forwarded-Proto it doesn't pick up X-Forwarded-Host (or any other custom header) which results in it generating invalid tokens and URLs.
There are also other scenarios in which having control of the Host header is useful - one example being Drupal systems where the site is determined by the Host header.

Your Environment

  • Version used: 1.5.0
  • Browser Name and version: Curl
  • Operating System and version: Windows 10, Centos 7.

@brasseld brasseld changed the title from Enable requests to internal endpoints to override the Host header to [gateway] Enable requests to internal endpoints to override the Host header Jun 15, 2017

brasseld added a commit to gravitee-io/gravitee-definition that referenced this issue Jun 15, 2017

brasseld added a commit to gravitee-io/gravitee-gateway that referenced this issue Jun 15, 2017

brasseld added a commit to gravitee-io/gravitee-management-rest-api that referenced this issue Jun 15, 2017

brasseld added a commit to gravitee-io/gravitee-management-webui that referenced this issue Jun 15, 2017

@brasseld brasseld self-assigned this Jun 15, 2017

brasseld added a commit to gravitee-io/gravitee-gateway that referenced this issue Jun 15, 2017

NicolasGeraud added a commit to gravitee-io/gravitee-management-webui that referenced this issue Jun 17, 2017

NicolasGeraud added a commit to gravitee-io/gravitee-definition that referenced this issue Jun 17, 2017

NicolasGeraud added a commit to gravitee-io/gravitee-gateway that referenced this issue Jun 17, 2017

NicolasGeraud added a commit to gravitee-io/gravitee-management-rest-api that referenced this issue Jun 17, 2017

@NicolasGeraud NicolasGeraud added this to the 1.7.0 milestone Jun 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment