This disables CSRF checking around the $repository->writeStatusMessage so that pushing changes over HTTP to Git repositories doesn't fail miserably.
Details
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Maniphest Tasks
- T4052: Crash when pushing content to Git repository
- Commits
- Restricted Diffusion Commit
rP3e2efaf00e57: Disable CSRF checks on Git push when updating repository.
Applied this fix and I could git push to hosted repositories again.
Diff Detail
Diff Detail
- Branch
- fix-csrf-crash-on-git-push
- Lint
Lint Passed - Unit
No Test Coverage
Event Timeline
Comment Actions
A slightly better approach is:
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); // ... unset($unguarded);
This does the right thing if the intervening code throws an exception. I'll tweak that in the pull. Thanks!
Comment Actions
I also made a small change to populate:
'REMOTE_USER' => $viewer->getUsername(),
...since Git seemed cranky without it when I was testing the $unguarded flavor.