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

FatalThrowableError in LumenCors.php line 21: #7

Open
KevinBeckers opened this issue Oct 18, 2016 · 3 comments
Open

FatalThrowableError in LumenCors.php line 21: #7

KevinBeckers opened this issue Oct 18, 2016 · 3 comments

Comments

@KevinBeckers
Copy link

Hi, I get the following error when I use:

$headers = array('Content-Type' => 'application/zip');
return response()->download("file", "test", $headers);
FatalThrowableError in LumenCors.php line 21:
Call to undefined method Symfony\Component\HttpFoundation\BinaryFileResponse::header()
in LumenCors.php line 21
at LumenCors->setOrigin(object(Request), object(BinaryFileResponse)) in LumenCors.php line 86
at LumenCors->setCorsHeaders(object(Request), object(BinaryFileResponse)) in LumenCors.php line 108
at LumenCors->handle(object(Request), object(Closure))
at call_user_func_array(array(object(LumenCors), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in RoutesRequests.php line 633
at Application->sendThroughPipeline(array('palanik\lumen\Middleware\LumenCors'), object(Closure)) in RoutesRequests.php line 389
at Application->dispatch(null) in RoutesRequests.php line 334
at Application->run() in index.php line 28
at require('/Users/Kevin/Projecten/api/bapi/public/index.php') in server.php line 106

Thx in advance

@jasonjiang123
Copy link

me too

@daiplusplus
Copy link

The quick-fix is to open LumenCors..php and replace every occurence of $rsp->header( x, y ) with $rsp->headers->set( x, y ). I'll submit a PR later.

@daiplusplus
Copy link

I've now submitted a PR: #12

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

No branches or pull requests

3 participants