Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionServeController.php
Show First 20 Lines • Show All 296 Lines • ▼ Show 20 Lines | if ($this->getIsGitLFSRequest() && $this->getGitLFSToken()) { | ||||
$repository->canServeProtocol($proto_http, false); | $repository->canServeProtocol($proto_http, false); | ||||
if (!$can_read) { | if (!$can_read) { | ||||
return new PhabricatorVCSResponse( | return new PhabricatorVCSResponse( | ||||
403, | 403, | ||||
pht('This repository is not available over HTTP.')); | pht('This repository is not available over HTTP.')); | ||||
} | } | ||||
if ($is_push) { | if ($is_push) { | ||||
if ($repository->isReadOnly()) { | |||||
return new PhabricatorVCSResponse( | |||||
503, | |||||
$repository->getReadOnlyMessageForDisplay()); | |||||
} | |||||
$can_write = | $can_write = | ||||
$repository->canServeProtocol($proto_https, true) || | $repository->canServeProtocol($proto_https, true) || | ||||
$repository->canServeProtocol($proto_http, true); | $repository->canServeProtocol($proto_http, true); | ||||
if (!$can_write) { | if (!$can_write) { | ||||
return new PhabricatorVCSResponse( | return new PhabricatorVCSResponse( | ||||
403, | 403, | ||||
pht('This repository is read-only over HTTP.')); | pht('This repository is read-only over HTTP.')); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 954 Lines • Show Last 20 Lines |