Skip to content

Conversation

lukinovec
Copy link
Contributor

@lukinovec lukinovec commented Aug 7, 2025

Before, when using UrlGeneratorBootstrapper, and your app had a https:// url, in tenant context, the url would have the http:// scheme.

Now, the bootstrapper makes sure that the TenancyUrlGenerator inherits the original UrlGenerator's scheme. So if your app has e.g. url "https://some-url.test", route('home') in tenant context will return "https://some-url.test/home" (originally, you'd get "http://some-url.test/home" - the original scheme - https - wouldn't be respected in the tenant context).

This PR addresses the issue reported on Discord (https://discord.com/channels/976506366502006874/976506736120823909/1399012794514411621).

Copy link

codecov bot commented Aug 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.96%. Comparing base (3984d64) to head (b7b5e4d).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1390   +/-   ##
=========================================
  Coverage     85.95%   85.96%           
  Complexity     1098     1098           
=========================================
  Files           178      178           
  Lines          3204     3206    +2     
=========================================
+ Hits           2754     2756    +2     
  Misses          450      450           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +83 to +84
$originalScheme = Str::before($this->originalUrlGenerator->formatScheme(), '://');
$newGenerator->forceScheme($originalScheme);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does formatScheme() return if no scheme was forced? Is it just http://?

Wondering if we can detect if a scheme was forced so we do not force a scheme if a scheme was not forced on the original generator.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests should also probably first start with a case where the scheme was not forced.

@stancl stancl marked this pull request as draft August 25, 2025 13:45
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.

2 participants