mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9658aa80ba | ||
|
08b1640ea3 |
@@ -5,7 +5,7 @@ php:
|
||||
- 5.5
|
||||
- 5.6
|
||||
- hhvm
|
||||
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: hhvm
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@@ -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"
|
||||
|
@@ -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 {
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user