Skip to content

3.x: fix basepath in redirecthandler#218

Closed
LordSimal wants to merge 1 commit into3.xfrom
3.x-fix-basepath
Closed

3.x: fix basepath in redirecthandler#218
LordSimal wants to merge 1 commit into3.xfrom
3.x-fix-basepath

Conversation

@LordSimal
Copy link
Copy Markdown
Contributor

@LordSimal LordSimal commented Dec 21, 2022

The current tests for 3.x fail due to the fact that the basepath is not handled correctly.

1) Authorization\Test\TestCase\Middleware\UnauthorizedHandler\CakeRedirectHandlerTest::testHandleRedirectWithBasePath
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'/basedir/login?redirect=%2Fadmin%2Fdashboard'
+'/login?redirect=%2Fadmin%2Fdashboard'

@LordSimal LordSimal added this to the 3.0 milestone Dec 21, 2022
$url['_base'] = $requestBase;
}

return Router::url($url);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't Router::url() here handle the base path? The test might just need to use Router::setRequest()?

@ADmad
Copy link
Copy Markdown
Member

ADmad commented Dec 22, 2022

I did a 2.x => 3.x merge and fixed this with other issues. Using Router::setRequest() is the proper way to fix it.

@ADmad ADmad closed this Dec 22, 2022
@ADmad ADmad deleted the 3.x-fix-basepath branch December 22, 2022 04:01
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