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
F13084071: D16402.diff
Wed, Apr 24, 10:47 PM
Unknown Object (File)
Fri, Apr 19, 5:13 PM
Unknown Object (File)
Thu, Apr 11, 7:41 AM
Unknown Object (File)
Thu, Apr 11, 6:25 AM
Unknown Object (File)
Fri, Apr 5, 4:33 PM
Unknown Object (File)
Mar 23 2024, 2:47 AM
Unknown Object (File)
Mar 22 2024, 1:00 PM
Unknown Object (File)
Mar 4 2024, 7:03 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.