[ 
https://issues.apache.org/jira/browse/CAMEL-12855?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thiago Locatelli updated CAMEL-12855:
-------------------------------------
    Description: 
We have a camel spring boot application sitting behind an api gateway with a 
Swagger page for accessing the documentation for all of our services (created 
with Spring Boot and Zuul Proxy, Consul as service discovery). The Swagger 
gateway sends three headers to the camel application to retrieve the swagger 
docs, but camel-swagger-java is not honoring those headers, thus the attributes 
host, basePath and schemes remain the same as if the swagger documentation was 
being acessed directly.

Example, when trying to get the swagger docs for our customer-service camel 
application:

[https://api-gateway.dev-internal.io/api-gateway/customer-service/v2/api-docs]

 
{code:java}
x-forwarded-prefix: /api-gateway/
x-forwarded-host: api-gateway.dev-internal.io
x-forwarded-proto: https,http{code}
 

The expected results should be
{code:java}
{
    "swagger": "2.0",
    ...
    "host": "api-gateway.dev-internal.io",
    "basePath": "/api-gateway/customer-service",
    "schemes": [ "https", "http" ]
    ...
}{code}
Current results:
{code:java}
{
    "swagger": "2.0",
    ...
    "host": "",
    "basePath": "/customer-service",
    "schemes": [ "http" ]
    ...
}{code}
 

 

  was:
We have a camel spring boot application sitting behind an api gateway with a 
Swagger page for accessing the documentation for all of our services (created 
with Spring Boot and Zuul Proxy, Consul as service discovery). The Swagger 
gateway sends three headers to the camel application to retrieve the swagger 
docs, but camel-swagger-java is not honoring those headers, thus the attributes 
host, basePath and schemes are not honored.

Example, when trying to get the swagger docs for our customer-service camel 
application:

https://api-gateway.dev-internal.io/api-gateway/customer-service/v2/api-docs

 
{code:java}
x-forwarded-prefix: /api-gateway/
x-forwarded-host: api-gateway.dev-internal.io
x-forwarded-proto: https,http{code}
 

The expected results should be
{code:java}
{
    "swagger": "2.0",
    ...
    "host": "api-gateway.dev-internal.io",
    "basePath": "/api-gateway/customer-service",
    "schemes": [ "https", "http" ]
    ...
}{code}
Current results:
{code:java}
{
    "swagger": "2.0",
    ...
    "host": "",
    "basePath": "/customer-service",
    "schemes": [ "http" ]
    ...
}{code}
 

 


> camel-swagger-java not honoring the x-forwarded-[host,proto,prefix] headers.
> ----------------------------------------------------------------------------
>
>                 Key: CAMEL-12855
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12855
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-swagger
>    Affects Versions: 2.22.1
>            Reporter: Thiago Locatelli
>            Priority: Major
>
> We have a camel spring boot application sitting behind an api gateway with a 
> Swagger page for accessing the documentation for all of our services (created 
> with Spring Boot and Zuul Proxy, Consul as service discovery). The Swagger 
> gateway sends three headers to the camel application to retrieve the swagger 
> docs, but camel-swagger-java is not honoring those headers, thus the 
> attributes host, basePath and schemes remain the same as if the swagger 
> documentation was being acessed directly.
> Example, when trying to get the swagger docs for our customer-service camel 
> application:
> [https://api-gateway.dev-internal.io/api-gateway/customer-service/v2/api-docs]
>  
> {code:java}
> x-forwarded-prefix: /api-gateway/
> x-forwarded-host: api-gateway.dev-internal.io
> x-forwarded-proto: https,http{code}
>  
> The expected results should be
> {code:java}
> {
>     "swagger": "2.0",
>     ...
>     "host": "api-gateway.dev-internal.io",
>     "basePath": "/api-gateway/customer-service",
>     "schemes": [ "https", "http" ]
>     ...
> }{code}
> Current results:
> {code:java}
> {
>     "swagger": "2.0",
>     ...
>     "host": "",
>     "basePath": "/customer-service",
>     "schemes": [ "http" ]
>     ...
> }{code}
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to