Skip to content

Generate correct redirect URL when using TRUSTED_HOST #91

@alexandersch

Description

@alexandersch

When having set the TRUSTED_PROXIES and TRUSTED_HOSTS, generated URLs will use the URL provided by the X-FORWARDED-HOST header when fetching a page through the API (e.g. in a `text_editor' content type this will replace the absolute URLs with the provided URL in the header).

A page that has been configured as an internal link will generate a redirect when fetching the page through API. This is all correct behaviour.

The problem is that the generated redirect URL is then also using the forwarded host header. I think this should be the Sulu URL and not the provided URL by the forwarded host header.

Consequence is that the frontend follows redirects and fetches the wrong (redirected) URL, thus no JSON content from Sulu.

Please let me know if more info or examples are needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Technical DebtImpacts only code quality, no or just small impact on end developers and users

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions