Merge pull request #431 from juliangut/redirectUri

V5 - use Psr\Http\Message\UriInterface
This commit is contained in:
Alex Bilbie
2016-02-11 17:35:33 +00:00
2 changed files with 7 additions and 35 deletions

View File

@@ -6,6 +6,7 @@ use League\OAuth2\Server\Utils\RedirectUri;
use Psr\Http\Message\ResponseInterface;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequest;
use Zend\Diactoros\Uri;
class OAuthServerException extends \Exception
{
@@ -236,7 +237,12 @@ class OAuthServerException extends \Exception
}
if ($this->redirectUri !== null) {
$headers['Location'] = RedirectUri::make($this->redirectUri, $payload);
$redirectUri = new Uri($this->redirectUri);
parse_str($redirectUri->getQuery(), $redirectPayload);
$headers['Location'] = (string) $redirectUri->withQuery(http_build_query(
array_merge($redirectPayload, $payload)
));
}
foreach ($headers as $header => $content) {