Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.x - Fix RouteCollectorProxy::redirect() Bug #2816

Merged
merged 1 commit into from Aug 20, 2019

Conversation

@l0gicgate
Copy link
Contributor

commented Aug 20, 2019

Fix for #2815

When a container is present the callable gets bound to the container when it's resolved. So the $this context becomes the container and not RouteCollectorProxy anymore.

$handler = function () use ($to, $status) {
    $response = $this->responseFactory->createResponse($status);
    return $response->withHeader('Location', (string) $to);
};

We're using $this->responseFactory() when we should just pass it in via use()

@l0gicgate l0gicgate added the Slim 4 label Aug 20, 2019

@l0gicgate l0gicgate added this to the 4.2.0 milestone Aug 20, 2019

@l0gicgate l0gicgate requested a review from adriansuter Aug 20, 2019

@coveralls

This comment has been minimized.

Copy link

commented Aug 20, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 5128833 on l0gicgate:FixRedirectBug into 806adf2 on slimphp:4.x.

@adriansuter

This comment has been minimized.

Copy link
Contributor

commented Aug 20, 2019

Is there a reason for the container prophecy in the test case? CallableResolver can be used without.

Other than that, everything looks fine. Can't officially approve as my phone app (OctoDroid) has a bug.

@adriansuter

This comment has been minimized.

Copy link
Contributor

commented Aug 20, 2019

Ah, should have read the issue. Everything is good!

@l0gicgate l0gicgate merged commit 89f8076 into slimphp:4.x Aug 20, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 100.0%
Details

@l0gicgate l0gicgate deleted the l0gicgate:FixRedirectBug branch Aug 20, 2019

@l0gicgate l0gicgate referenced this pull request Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.