mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-22 19:19:18 -05:00
test: make remote.php configurable
test: build dav paths test: fix paths test: merge method args test: add issue tags test: add new expected failure file test: merge expected-failure files before running tests
This commit is contained in:
@@ -104,6 +104,27 @@ class HttpRequestHelper {
|
||||
$timeout
|
||||
);
|
||||
}
|
||||
|
||||
if (WebdavHelper::isDAVRequest($url) && \str_starts_with($url, OcisHelper::getServerUrl())) {
|
||||
$withRemotePhp = \getenv("WITH_REMOTE_PHP") === "true";
|
||||
$urlHasRemotePhp = \str_contains($url, 'remote.php');
|
||||
if (!$withRemotePhp && $urlHasRemotePhp) {
|
||||
throw new Exception("remote.php is disabled but found in the URL: $url");
|
||||
}
|
||||
if ($withRemotePhp && !$urlHasRemotePhp) {
|
||||
throw new Exception("remote.php is enabled but not found in the URL: $url");
|
||||
}
|
||||
|
||||
if ($headers && \array_key_exists("Destination", $headers)) {
|
||||
if (!$withRemotePhp && $urlHasRemotePhp) {
|
||||
throw new Exception("remote.php is disabled but found in the URL: $url");
|
||||
}
|
||||
if ($withRemotePhp && !$urlHasRemotePhp) {
|
||||
throw new Exception("remote.php is enabled but not found in the URL: $url");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$request = self::createRequest(
|
||||
$url,
|
||||
$xRequestId,
|
||||
|
||||
Reference in New Issue
Block a user