Laravel in Apache getting header value

前端 未结 2 2002
忘了有多久
忘了有多久 2021-02-10 22:42

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 23:05

    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

提交回复
热议问题