Laravel in Apache getting header value

前端 未结 2 762
灰色年华
灰色年华 2021-02-10 22:36

I have the following piece of code in Laravel BaseController. I want to protect all my api resources with an Authorization header with a token.

  pu         


        
2条回答
  •  温柔的废话
    2021-02-10 22:58

    It is a Laravel & Apache problem, this line in public/.htaccess fixed it for me:

    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    

    The fix is from https://github.com/dingo/api/issues/54

提交回复
热议问题