Page MenuHomePhabricator

Fix Phriction document previews for the root document ("/") with Apache option "MergeSlashes On"
ClosedPublic

Authored by epriestley on Jul 26 2021, 6:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 8 2024, 10:06 PM
Unknown Object (File)
Feb 4 2024, 1:18 AM
Unknown Object (File)
Jan 19 2024, 4:43 PM
Unknown Object (File)
Jan 15 2024, 5:08 PM
Unknown Object (File)
Jan 12 2024, 1:11 PM
Unknown Object (File)
Jan 11 2024, 6:21 PM
Unknown Object (File)
Jan 7 2024, 4:27 PM
Unknown Object (File)
Jan 3 2024, 7:10 PM
Subscribers
None

Details

Summary

Ref T13662. I ran into this while trying to reproduce the mention issue discussed there.

Currently, the root document (with slug "/") attempts to preview using the URI /phriction/preview// (with two // at the end). This is collapsed into "/phriction/preview/" by Apache if "MergeSlashes On" is configured, which is the default behavior. The route then 404s.

Instead, just use "/phriction/preview/?slug=/" so this endpoint functions properly regardless of the "MergeSlashes" configuration.

Test Plan
  • Configured Apache with "MergeSlashes On" (which is the default behavior).
  • Tried to preview a content edit of the root document in Phriction, which didn't work and generated 404s for "/phriction/preview//" in the console log.
  • Applied patch.
  • Previwed content in Phriction (which now worked properly).
  • Accessed /a//b///c//// and similar with "MergeSlashes On" and "MergeSlashes Off", confirmed that this option controls whether PHP receives a URI with or without merged slashes in "path" after rewriting.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley edited the test plan for this revision. (Show Details)

This also fixes root document preview in lighttpd, which seems to have mandatory slash merging.

This revision is now accepted and ready to land.Aug 1 2021, 6:08 PM