camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonas Koperdraat <jo...@jonaskoperdraat.nl>
Subject 'host' configuration param not used by servlet
Date Wed, 02 Nov 2016 13:57:10 GMT
I have a REST API for which I am exposing a swagger definitiion using
camel-swagger-java. The application is deployed behind a proxy,
because of which I need to change host used in the generated swagger
documentation. Currently, the internal hostname of the actual machine
is being used, based on the host in the request. Because I want to
make the swagger api public, I need this to be the public hostname,
that which is configured in the proxy.

According to the documentation of camel-swagger-java
(http://camel.apache.org/swagger-java.html), the 'host' option allows
me to do just that; "To setup the hostname." However, this seems not
to be working. I have looked ad the code, and it seems to me, that
there is something wrong with the implementation of the
RestSwaggerServlet:

In org.apache.camel.swagger.servlet.RestSwaggerServlet, there's the
method doGet, which is called for each request. The first time this is
called, 'initBaseAndApiPaths' is called to do some initialization.
Debugging shows that when entering this method, the 'host'
configuration is propertly set to the value specified in my web.xml
file. However, the logic in this method is such that the host will
always be overridden with the host of the request url, thereby
rendering the 'host' configuration parameter useless.

It seems to me that this is a bug, but I might be mistaken, Is anyone
else familiar with this problem and aware of a solution/workaround?

Kind regards,

Jonas

Mime
View raw message