Page MenuHomePhabricator

Don't emit Content-Security-Policy when returning a response during preflight setup checks
ClosedPublic

Authored by epriestley on Mar 5 2018, 2:52 PM.
Tags
None
Referenced Files
F17726419: D19172.id45926.diff
Fri, Jul 18, 3:09 PM
F17703961: D19172.id45926.diff
Wed, Jul 16, 2:52 AM
F17659274: D19172.diff
Sat, Jul 12, 2:13 PM
Unknown Object (File)
Jun 18 2025, 9:54 AM
Unknown Object (File)
Jun 1 2025, 12:29 PM
Unknown Object (File)
May 31 2025, 1:43 PM
Unknown Object (File)
May 31 2025, 12:12 PM
Unknown Object (File)
Apr 30 2025, 12:19 PM
Subscribers
None

Details

Summary

Ref T4340. See https://discourse.phabricator-community.org/t/core-exception-during-installation/1193/8.

If we return a response very early during setup, we may not be able to read from the environment yet. Just decline to build a "Content-Security-Policy" header in these cases.

Test Plan
  • Faked a preflight error (e.g., safe_mode enabled), restarted apache.
    • Before patch: environment error while generating CSP.
    • After patch: no error.
  • Loaded a normal page, observed an normal CSP header.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Mar 5 2018, 2:53 PM
epriestley requested review of this revision.
This revision was automatically updated to reflect the committed changes.