Compare commits

..

2 Commits
3.2.3 ... 3.2.2

Author SHA1 Message Date
Phil Sturgeon
9658aa80ba Rejiggery. 2014-07-15 15:50:11 +01:00
Phil Sturgeon
08b1640ea3 Merge branch 'develop' of github.com:thephpleague/oauth2-server 2014-07-15 15:48:42 +01:00
7 changed files with 8 additions and 16 deletions

View File

@@ -5,7 +5,7 @@ php:
- 5.5
- 5.6
- hhvm
matrix:
allow_failures:
- php: hhvm

View File

@@ -1,9 +1,5 @@
# Changelog
## 3.2.2 (released 2014-07-23)
* Fix Resource server Request HTTP header access (Issue #188)
## 3.2 (released 2014-04-16)
* Added the ability to change the algorithm that is used to generate the token strings (Issue #151)

View File

@@ -12,7 +12,7 @@ The framework is provided as a Composer package which can be installed by adding
```javascript
{
"require": {
"league/oauth2-server": "3.*"
"league/oauth2-server": "~3.2"
}
}
```

View File

@@ -1,7 +1,6 @@
{
"name": "league/oauth2-server",
"description": "A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.",
"version": "3.2.3",
"license": "MIT",
"require": {
"php": ">=5.4.0"

View File

@@ -165,7 +165,7 @@ class Resource
// @codeCoverageIgnoreStart
if ($error === 'invalid_token') {
$authScheme = null;
$request = Request::buildFromGlobals();
$request = new Request();
if ($request->server('PHP_AUTH_USER') !== null) {
$authScheme = 'Basic';
} else {

View File

@@ -76,25 +76,22 @@ class Request implements RequestInterface
protected function readHeaders()
{
if (function_exists('apache_request_headers')) {
if (function_exists('getallheaders')) {
// @codeCoverageIgnoreStart
$headers = apache_request_headers();
} elseif (function_exists('http_get_request_headers')) {
$headers = http_get_request_headers();
$headers = getallheaders();
} else {
// @codeCoverageIgnoreEnd
$headers = array();
foreach ($this->server() as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') {
// HTTP_FOO_BAR becomes FOO-BAR
$name = str_replace(array('HTTP_', '_'), array('', '-'), $name);
$name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))));
$headers[$name] = $value;
}
}
}
return $this->normalizeHeaders($headers);
}
}
protected function getPropertyValue($property, $index = null, $default = null)
{
@@ -146,4 +143,4 @@ class Request implements RequestInterface
return $key;
}
}
}