Page MenuHomePhabricator

Convert some whiny exceptions into quiet MalformedRequest exceptions
ClosedPublic

Authored by epriestley on Aug 16 2016, 9:07 PM.
Tags
None
Referenced Files
F14050130: D16402.diff
Thu, Nov 14, 4:40 PM
F14038966: D16402.diff
Mon, Nov 11, 2:59 AM
F14037891: D16402.id39444.diff
Sun, Nov 10, 7:51 PM
F14022956: D16402.diff
Wed, Nov 6, 9:10 PM
F14014348: D16402.id.diff
Sun, Nov 3, 2:01 AM
F13992154: D16402.diff
Tue, Oct 22, 2:41 PM
F13961098: D16402.id39444.diff
Oct 15 2024, 3:08 AM
Unknown Object (File)
Oct 2 2024, 3:22 PM
Subscribers
None

Details

Summary

Fixes T11480. This cleans up the error logs a little by quieting three common errors which are really malformed requests:

  • The CSRF error happens when bots hit anything which does write checks.
  • The "wrong cookie domain" errors happen when bots try to use the security.alternate-file-domain to browse stuff like /auth/start/.
  • The "no phcid" errors happen when bots try to go through the login flow.

All of these are clearly communicated to human users, commonly encountered by bots, and not useful to log.

I collapsed the CSRFException type into a standard malformed request exception, since nothing catches it and I can't really come up with a reason why anything would ever care.

Test Plan

Hit each error through some level of curl -H ... and/or fakery. Verified that they showed to users before/after, but no longer log.

Hit some other real errors, verified that they log.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Convert some whiny exceptions into quiet MalformedRequest exceptions.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Aug 16 2016, 10:43 PM
This revision was automatically updated to reflect the committed changes.