2017 © Pedro Peláez
 

library authorization-header-fix

Simple listener that restore Authorization header in a Symfony Request under Apache.

image

alcalyn/authorization-header-fix

Simple listener that restore Authorization header in a Symfony Request under Apache.

  • Sunday, December 4, 2016
  • by alcalyn
  • Repository
  • 0 Watchers
  • 1 Stars
  • 1,417 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Authorization header fix

Using a Symfony application on Apache, you get null when trying to get Authorization header with $request->headers->get('Authorization');., (*1)

The why is explained in this Stackoverflow question., (*2)

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., (*3)

Installation

Download

Using Composer:, (*4)

``` js { "require": { "alcalyn/authorization-header-fix": "1.0.x" } }, (*5)



### Register listener To fix all Requests in a full stack Symfony app, register a listener like this: ``` yml # 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:, (*6)

php $this->on('kernel.request', array( new Alcalyn\AuthorizationHeaderFix\AuthorizationHeaderFixListener(), 'onKernelRequest' ), 10);, (*7)

Note:, (*8)

An higher priority is recommended to have the Authorization header available in others listeners., (*9)

License

This library is under MIT License., (*10)

The Versions

04/12 2016

dev-master

9999999-dev https://github.com/alcalyn/authorization-header-fix

Simple listener that restore Authorization header in a Symfony Request under Apache.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

php symfony apache

04/12 2016

1.0.1

1.0.1.0 https://github.com/alcalyn/authorization-header-fix

Simple listener that restore Authorization header in a Symfony Request under Apache.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

php symfony apache

30/01 2016

1.0.0

1.0.0.0 https://github.com/alcalyn/authorization-header-fix

Simple listener that restore Authorization header in a Symfony Request under Apache.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

php symfony apache