aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/api.php')
-rw-r--r--lib/private/api.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/private/api.php b/lib/private/api.php
index cd5148c51a1..10d58f2d9e6 100644
--- a/lib/private/api.php
+++ b/lib/private/api.php
@@ -386,7 +386,7 @@ class OC_API {
$meta = $result->getMeta();
$data = $result->getData();
- if (self::isV2()) {
+ if (self::isV2(\OC::$server->getRequest())) {
$statusCode = self::mapStatusCodes($result->getStatusCode());
if (!is_null($statusCode)) {
$meta['statuscode'] = $statusCode;
@@ -449,13 +449,13 @@ class OC_API {
}
/**
- * @return boolean
+ * @param \OCP\IRequest $request
+ * @return bool
*/
- private static function isV2() {
- $request = \OC::$server->getRequest();
+ protected static function isV2(\OCP\IRequest $request) {
$script = $request->getScriptName();
- return $script === '/ocs/v2.php';
+ return substr($script, -11) === '/ocs/v2.php';
}
/**