Skip to content

Server URL generated with http although called at external https endpont #2837

@Regenhardt

Description

@Regenhardt

Describe the bug
Calling an application via https through a load balancer when the applcation is internally using http generates the Server.Url in the OpenAPI document as http://... instead of https, rendering SwaggerUI completely unusable as it tries using http, which isn't available on the external endpoint.

OpenApi File To Reproduce
Can't share internal data.

Expected behavior
When called via https (e.g. https://myApp.example.org) when the application is behind a load balancer that uses http internally (no https or certificate between LB and application container), the generated server url should use https.

Screenshots/Code Snippets

SwaggerUI shows http as server even though it was called via https:
Image

The OpenAPI document also shows http on the server url even though called via https:
Image

The result is a broken call trying to call http when only https is available:
Image

Additional context
The application is called through a load balancer. HTTPS is managed on this outer layer, then internally there is not HTTPS, only HTTP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions