Fixed issue with // in some cases. We now normalize the endpoint so it does not have a trailing /.
This commit is contained in:
parent
83604c466b
commit
07b31bea03
@ -209,7 +209,7 @@ class IdentityServices /*implements Serializable*/ {
|
||||
$parts = parse_url($url);
|
||||
|
||||
if (!empty($parts['path'])) {
|
||||
$this->endpoint = $url;
|
||||
$this->endpoint = rtrim($url, '/');
|
||||
}
|
||||
else {
|
||||
$this->endpoint = rtrim($url, '/') . '/v' . self::API_VERSION;
|
||||
|
@ -53,7 +53,9 @@ class IdentityServicesTest extends \HPCloud\Tests\TestCase {
|
||||
$endpoint = self::conf('hpcloud.identity.url');
|
||||
$service = new IdentityServices($endpoint);
|
||||
|
||||
$this->assertStringStartsWith($endpoint, $service->url());
|
||||
// If there is a trailing / we remove that from the endpoint. Our calls add
|
||||
// the / back where appropriate.
|
||||
$this->assertStringStartsWith(rtrim($endpoint, '/'), $service->url());
|
||||
|
||||
return $service;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user