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

Changing ->header() to ->headers->set() #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

daiplusplus
Copy link

I recently did a composer update and the old $rsp->header() calls were failing with this error:

Call to undefined method Symfony\Component\HttpFoundation\Response::header()
in LumenCors.php (line 21)
at LumenCors->setOrigin(object(Request), object(Response))in LumenCors.php (line 86)
at LumenCors->setCorsHeaders(object(Request), object(Response))in LumenCors.php (line 108)
at LumenCors->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request))in Pipeline.php (line 32)
at Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))in Pipeline.php (line 102)
at Pipeline->then(object(Closure))in RoutesRequests.php (line 778)
at Application->sendThroughPipeline(array('palanik\\lumen\\Middleware\\LumenCors'),object(Closure))in RoutesRequests.php (line 534)
at Application->dispatch(null)in RoutesRequests.php (line 475)
at Application->run()in index.php (line 62)

This PR changes it to use $rsp->headers->set() which now works.

I don't know exactly when the breaking change was introduced.

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.

1 participant