Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

fix: improve domain method to handle forcedRoot and return cleaned URL#105

Merged
joetannenbaum merged 1 commit intolaravel:mainfrom
mrfade:fix/route/forced-root
Jan 12, 2026
Merged

fix: improve domain method to handle forcedRoot and return cleaned URL#105
joetannenbaum merged 1 commit intolaravel:mainfrom
mrfade:fix/route/forced-root

Conversation

@mrfade
Copy link
Contributor

@mrfade mrfade commented Sep 28, 2025

Fix: incorrect URLs when forceRoot is set

When forceRoot was used, Route::domain() returned the full root including the scheme. Since uri() prepends the scheme separately, this resulted in broken URLs like https://https//site.com/..., especially when forceScheme was also applied.

This change makes domain() return only the host part of forcedRoot (without http:// or https://). That way, combining it with scheme() produces a valid URL.

This also fixes the issue reported in Issue #102

@Manavsaliya
Copy link
Contributor

i think you can change Issue #102 to Fix #102 on last line

and you should write test cases for this issue

@s-veenstra-code24
Copy link

Is there any progress on this? I mean, it is still a problem I think?

@joetannenbaum joetannenbaum merged commit cc32fed into laravel:main Jan 12, 2026
10 checks passed
@joetannenbaum
Copy link
Collaborator

Thank you!

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.

4 participants