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
F15473643: D19172.diff
Sun, Apr 6, 12:26 AM
F15457174: D19172.id45925.diff
Sun, Mar 30, 2:43 PM
F15453788: D19172.id.diff
Sat, Mar 29, 2:22 PM
F15450461: D19172.diff
Fri, Mar 28, 3:49 PM
F15444818: D19172.id.diff
Thu, Mar 27, 11:26 AM
F15437694: D19172.id45925.diff
Tue, Mar 25, 9:02 PM
F15405023: D19172.diff
Tue, Mar 18, 10:02 AM
F15282897: D19172.id45926.diff
Mar 4 2025, 3:24 AM
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.