Page MenuHomePhabricator

D12622.id30307.diff
No OneTemporary

D12622.id30307.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -2698,6 +2698,7 @@
'PhabricatorVeryWowEnglishTranslation' => 'infrastructure/internationalization/translation/PhabricatorVeryWowEnglishTranslation.php',
'PhabricatorViewerDatasource' => 'applications/people/typeahead/PhabricatorViewerDatasource.php',
'PhabricatorWatcherHasObjectEdgeType' => 'applications/transactions/edges/PhabricatorWatcherHasObjectEdgeType.php',
+ 'PhabricatorWebServerSetupCheck' => 'applications/config/check/PhabricatorWebServerSetupCheck.php',
'PhabricatorWordPressAuthProvider' => 'applications/auth/provider/PhabricatorWordPressAuthProvider.php',
'PhabricatorWorker' => 'infrastructure/daemon/workers/PhabricatorWorker.php',
'PhabricatorWorkerActiveTask' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php',
@@ -6146,6 +6147,7 @@
'PhabricatorVeryWowEnglishTranslation' => 'PhutilTranslation',
'PhabricatorViewerDatasource' => 'PhabricatorTypeaheadDatasource',
'PhabricatorWatcherHasObjectEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorWebServerSetupCheck' => 'PhabricatorSetupCheck',
'PhabricatorWordPressAuthProvider' => 'PhabricatorOAuth2AuthProvider',
'PhabricatorWorkerActiveTask' => 'PhabricatorWorkerTask',
'PhabricatorWorkerArchiveTask' => 'PhabricatorWorkerTask',
diff --git a/src/applications/config/check/PhabricatorWebServerSetupCheck.php b/src/applications/config/check/PhabricatorWebServerSetupCheck.php
new file mode 100644
--- /dev/null
+++ b/src/applications/config/check/PhabricatorWebServerSetupCheck.php
@@ -0,0 +1,41 @@
+<?php
+
+final class PhabricatorWebServerSetupCheck extends PhabricatorSetupCheck {
+
+ public function getDefaultGroup() {
+ return self::GROUP_OTHER;
+ }
+
+ protected function executeChecks() {
+ $base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri');
+ $base_uri = new PhutilURI($base_uri);
+
+ switch ($base_uri->getProtocol()) {
+ case 'http':
+ $future = new HTTPFuture($base_uri->getProtocol().'://127.0.0.1');
+ break;
+
+ case 'https';
+ $future = new HTTPSFuture($base_uri->getProtocol().'://127.0.0.1');
+ break;
+
+ default:
+ return;
+ }
+
+ $future
+ ->addHeader('Host', $base_uri->getDomain())
+ ->addHeader('Accept-Encoding', 'gzip')
+ ->addHeader('Connection', 'Close');
+
+ list($status, $body, $headers) = $future->resolve();
+
+ if (BaseHTTPFuture::getHeader($headers, 'Content-Encoding') != 'gzip') {
+ $this->newIssue('webserver.gzip')
+ ->setName(pht('Enable gzip compression'))
+ ->setMessage(pht('Enable gzip compression.'));
+ return;
+ }
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 4:42 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7699701
Default Alt Text
D12622.id30307.diff (2 KB)

Event Timeline