From ee460b4f1b4c638e828218b9b5b4c964f5da01fc Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 6 Jul 2016 17:17:02 -0700 Subject: [PATCH] Redirect https blogs Summary: Ref T9360, forces https if we say the blog is https. Test Plan: Fake an https, get redirected. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9360 Differential Revision: https://secure.phabricator.com/D16241 --- src/applications/phame/site/PhameBlogSite.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/applications/phame/site/PhameBlogSite.php b/src/applications/phame/site/PhameBlogSite.php index 6a5eebaf31..20bdfd5230 100644 --- a/src/applications/phame/site/PhameBlogSite.php +++ b/src/applications/phame/site/PhameBlogSite.php @@ -18,9 +18,10 @@ final class PhameBlogSite extends PhameSite { } public function shouldRequireHTTPS() { - // TODO: We should probably provide options here eventually, but for now - // just never require HTTPS for external-domain blogs. - return false; + $full_uri = $this->getBlog()->getDomainFullURI(); + $full_uri = new PhutilURI($full_uri); + + return ($full_uri->getProtocol() == 'https'); } public function getPriority() {