Skip to content

Fix handling of relative URLs - #904

Closed
kitzberger wants to merge 1 commit into
TYPO3-Headless:4.xfrom
GFEMediaGmbH:fix-relative-urls
Closed

kitzberger wants to merge 1 commit into
TYPO3-Headless:4.xfrom
GFEMediaGmbH:fix-relative-urls

Conversation

@kitzberger

@kitzberger kitzberger commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Resolves: #903

When getFrontendUrlWithSite() receives a relative URL (e.g.
/powermail/optin/{hash}/{mail}), the early-return guard
->getHost() === '' caused the URL to be returned
unchanged without prepending the configured frontendBase.

The intent of that check (introduced in TYPO3-Headless#890) was to prevent
external URLs from being rewritten, but it was too broad: it
blocked ALL relative URLs since they have no host component.

This fix removes the empty-host check and adds an empty-host
guard to isExternalUrl() so that relative URLs are correctly
identified as non-external and get rewritten to absolute
frontend URLs.

Resolves: TYPO3-Headless#903
@coveralls

coveralls commented Jul 30, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 30570050471

Warning

No base build found for commit 246587b on 4.x.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 73.116%

Details

  • Patch coverage: 2 of 2 lines across 1 file are fully covered (100%).

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 1592
Covered Lines: 1164
Line Coverage: 73.12%
Coverage Strength: 8.45 hits per line

💛 - Coveralls

@twoldanski twoldanski closed this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants