alcalyn/authorization-header-fix
Composer 安装命令:
composer require alcalyn/authorization-header-fix
包简介
Simple listener that restore Authorization header in a Symfony Request under Apache.
README 文档
README
Using a Symfony application on Apache, you get null when trying to get Authorization header with $request->headers->get('Authorization');.
The why is explained in this Stackoverflow question.
So if you don't want to patch your .htaccess, this library, inspired by fschmengler's answer in this another SO question, provides a listener which adds the Authorization header to a Symfony Request instance.
Installation
Download
Using Composer:
{ "require": { "alcalyn/authorization-header-fix": "1.0.x" } }
Register listener
To fix all Requests in a full stack Symfony app, register a listener like this:
# app/config/services.yml services: acme.listeners.authorization_header_fix: class: Alcalyn\AuthorizationHeaderFix\AuthorizationHeaderFixListener tags: - { name: kernel.event_listener, event: kernel.request, priority: 10 }
Or using Silex:
$this->on('kernel.request', array( new Alcalyn\AuthorizationHeaderFix\AuthorizationHeaderFixListener(), 'onKernelRequest' ), 10);
Note:
An higher priority is recommended to have the Authorization header available in others listeners.
License
This library is under MIT License.
统计信息
- 总下载量: 1.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-01-30