Answer the question
In order to leave comments, you need to log in
Why are the headers not being read/sent?
I am correcting the mistakes of another programmer, but the problem turned out to be this:
the php yii2 framework is installed on the server.
The code is there:
$request->getHeaders()->get('Authorization');
The application sends the header:
Authorization: bearer $token$
using okhttp
the problem is that when I output $request->getHeaders();
then among all the headers there is no Authorization.
I use ChuckInterceptor to view requests in a mobile application.
What could be the problem?
ps my authentication fails due to the missing Authorization header, but if I look at the ChuckInterceptor debugger, it says that the header has been sent.
Answer the question
In order to leave comments, you need to log in
the problem was the following, CPanel was installed on the server, and Cpanel was removing the Authorization header for its own security.
There were 2 decisions to do something with Cpanel (this is a separate order from a freelancer).
and change the authorization header, for example, to tokenApi and parse something from it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question