We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Can't get authorization header

Hi!

@Phalcon Iam trying to secure my api, in every request have this request header:

Accept application/json, text/plain, / Accept-Encoding gzip, deflate Accept-Language es-AR,es;q=0.8,en-US;q=0.5,en;q=0.3 Authorization Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOnsiaWQiOiIxIiwidXN1YXJpbyI6InRoZV9wZWxhZG8iLCJu b21icmUiOiJDcmlzdGlhbiBCcnVuYWNjaSIsImNsdWIiOiJhbHZhcmFkbyJ9LCJpYXQiOjE0MzA5NTk3NDMsImV4cCI6MTQzMjE2OTM0M30 .f40Osl75MHEqHlvRSUJa_yOxl0aQpDMZeFe6BWA78P0 Cookie
_ga=GA1.1.111585643.1418606049; atuvc=48%7C51%2C24%7C53%2C15%7C0; utma=111872281.111585643.1418606049 .1425423235.1425423235.1; __utmz=111872281.1425423235.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none ); PHPSESSID=0r1mm4274ceaftns6h621ss242 Host
localhost Referer https://localhost/clooble/ User-Agent
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0

But in the server, i have this headers:

Array ( [Host] => localhost [User-Agent] => Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0 [Accept] => application/json, text/plain, / [Accept-Language] => es-AR,es;q=0.8,en-US;q=0.5,en;q=0.3 [Accept-Encoding] => gzip, deflate [Referer] => https://localhost/clooble/ [Cookie] => _ga=GA1.1.111585643.1418606049; atuvc=48%7C51%2C24%7C53%2C15%7C0; utma=111872281 .111585643.1418606049.1425423235.1425423235.1; __utmz=111872281.1425423235.1.1.utmcsr=(direct)|utmccn =(direct)|utmcmd=(none); PHPSESSID=0r1mm4274ceaftns6h621ss242 [Connection] => keep-alive )

Why I don't have 'Authorization' header?

Thanks!



43.9k

Hi,

is the array the result of:


$response = new Phalcon\Http\Response;
var_dump($response->getHeaders());