I agree with Jonas original comment.

Since camel-swagger-java allows for explicitly setting a hostname it should
have precedence over the hostname taken from the servlet context
(regardless if it in turn is taken from 'X-Forwarded-Host' or 'Host').

@Jonas: I would suggest that you log a Jira with your findings.

// Pontus


On Fri, 11 Nov 2016 at 03:26 Vitalii Tymchyshyn <v...@tym.im> wrote:

> In Tomcat you can add
>
> https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html
>
> Ср, 2 лист. 2016 о 13:51 Jonas Koperdraat <jo...@jonaskoperdraat.nl> пише:
>
> > Hi Zoran,
> >
> > I've checked and the proxy sets the 'X-Forwarded-Host' header and this
> > contains the 'correct' host. The 'Host' header is also present on the
> > request and this contains the hostname of the actual machine the servlet
> is
> > running on. I'm not sure if we have the option to set it, but seeing as
> we
> > already have the desired hostname available in de 'X-Forwarded-Host'
> option
> > I'm not going to investigate that further ;-)
> >
> > But I guess our servlet container, which indeed is Tomcat, doesn't take
> the
> > X-Forwarded-Host header into consideration when constructing the
> requestUrl
> > parameter of the SerlvetRequest. So we'll have to manually insert the
> > desired hostname into the request url.
> >
> > Kind regards,
> >
> > Jonas
> >
> > Op wo 2 nov. 2016 om 16:33 schreef Zoran Regvart <zregv...@redhat.com>:
> >
> > > Hi Jonas,
> > >
> > > On Wed, Nov 2, 2016 at 4:25 PM, Jonas Koperdraat
> > > <jo...@jonaskoperdraat.nl> wrote:
> > > > I don't know whether that header is being sent by the proxy. Should
> > that
> > > > impact the behavior I am seeing (e.g. should does that influence the
> > > result
> > > > of getRequestURL)?
> > >
> > > It does on some Servlet engines / middlewares, it might not in your
> > > case, especially if you're using Tomcat.
> > >
> > > Another header that you might want to investigate is the `Host`
> > > header, it's used for virtual hosts, and you might have an option to
> > > set it in your proxy (on the request sent to the backend).
> > >
> > > zoran
> > > --
> > > Zoran Regvart
> > > zregv...@redhat.com
> > >
> >
>

Reply via email to