Page MenuHomePhabricator

Fix `security.require-https` by marking redirect as external
ClosedPublic

Authored by hach-que on Aug 21 2014, 9:58 AM.
Tags
None
Referenced Files
F13216039: D10318.id.diff
Fri, May 17, 9:59 PM
F13203684: D10318.diff
Tue, May 14, 11:59 PM
F13189297: D10318.diff
Sat, May 11, 5:51 AM
Unknown Object (File)
Wed, Apr 24, 11:05 PM
Unknown Object (File)
Apr 10 2024, 4:00 AM
Unknown Object (File)
Mar 31 2024, 8:33 PM
Unknown Object (File)
Mar 2 2024, 3:26 AM
Unknown Object (File)
Mar 2 2024, 3:26 AM
Subscribers

Details

Summary

Resolves T5937. HTTPS redirects caused by security.require-https use a full scheme, domain and port in the URI. Consequently, this causes invocation of the new external redirect logic and prevents redirection from occurring properly when accessing the HTTP version of Phabricator that has security.require-https turned on.

I've also fixed the automatic slash redirection logic to add the external flag where appropriate.

Test Plan

Configured SSL on my local machine and turned on security.require-https. Observed the "Refusing to redirect" exception on master, while the redirect completed successfully with this patch.

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

hach-que retitled this revision from to Fix `security.require-https` by marking redirect as external.
hach-que updated this object.
hach-que edited the test plan for this revision. (Show Details)
hach-que added a reviewer: epriestley.
hach-que edited edge metadata.

The automatic slash redirect requires external to be turned off for local redirects

src/aphront/configuration/AphrontApplicationConfiguration.php
195–196

I'm not sure whether this redirect is always local, but it's at least not always absolute.

In either case, the request URI domain currently hits Phabricator successfully, so it should be safe to redirect regardless of whether this is a relative or absolute URI (because the absolute URI can only ever point at Phabricator).

This revision is now accepted and ready to land.Aug 21 2014, 11:22 AM
hach-que updated this revision to Diff 24844.

Closed by commit rPa2a0f002f069 (authored by @hach-que).