mirror of
https://github.com/ovh/php-ovh.git
synced 2023-11-05 03:20:26 +01:00
Always retrieve schema description in unauthenticated mode
This commit is contained in:
parent
e56816612a
commit
74c0e89305
16
src/Api.php
16
src/Api.php
@ -331,9 +331,19 @@ class Api
|
|||||||
*/
|
*/
|
||||||
public function get($path, $content = null, $headers = null, $is_authenticated = true)
|
public function get($path, $content = null, $headers = null, $is_authenticated = true)
|
||||||
{
|
{
|
||||||
return $this->decodeResponse(
|
if(preg_match('/^\/[^\/]+\.json$/', $path))
|
||||||
$this->rawCall("GET", $path, $content, $is_authenticated, $headers)
|
{
|
||||||
);
|
// Schema description must be access without authentication
|
||||||
|
return $this->decodeResponse(
|
||||||
|
$this->rawCall("GET", $path, $content, false, $headers)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $this->decodeResponse(
|
||||||
|
$this->rawCall("GET", $path, $content, $is_authenticated, $headers)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -257,6 +257,6 @@ class ApiFunctionalTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function testApiGetWithoutAuthentication()
|
public function testApiGetWithoutAuthentication()
|
||||||
{
|
{
|
||||||
$api = new Api(NULL,NULL, $this->endpoint, null, $this->client);
|
$api = new Api(NULL,NULL, $this->endpoint, null, $this->client);
|
||||||
$api->get('/hosting/web/moduleList');
|
$api->get('/hosting/web/moduleList',null,null,false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user