Redirect-loop when route renders no custom-elements

Created on 18 April 2025, 9 days ago

Problem

We have redirection logic that routes to the backend, whenever an URL is accessed that shall render into custom_elements but does not support it.

Example:
https://lupus-decoupled.ddev.site/ce-api/node/1/edit
->
Redirects to https://lupus-decoupled.ddev.site/ce-api/node/1/edit
That example works good.

However, when there is a route which has is specified to be of format custom_elements, but was not requested like this, then the same happens. Then the redirect is
/route-with-format-ce-but-no-ce-response --> redirects to /route-with-format-ce-but-no-ce-response

This does not make sense.

Steps to reproduce

Define new route with _format = custom_elements
Return render array without CE.
Open it.

Proposed resolution

To avoid this, we shall not apply the redirect if there is only one single format registered for the given route AND the format is custom_elements. In that case we could even force-render it with custom-elements, since it was defined like this, or error out.

Remaining tasks

Solve and write test coverage

🐛 Bug report
Status

Active

Version

2.3

Component

Code

Created by

🇦🇹Austria fago Vienna

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024