diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-27 19:43:41 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-27 20:38:25 +0000 |
| commit | 3a7fa1d1288c28eae0ee58b4c448c672ec3b69c2 (patch) | |
| tree | 13afc5d8abeb0a358701ede483d6ec4a7485c9f4 /docs/how-to | |
| parent | 10eab82164bb91236f2afa6b7919d0710609ba7f (diff) | |
fix: return HTTP 200 with ERR pkt-line for git protocol errors
Previously, all git upload-pack/receive-pack failures returned HTTP 500,
but the git smart HTTP protocol requires protocol-level errors (like
"not our ref") to be returned as HTTP 200 OK with an ERR pkt-line in
the response body.
Changes:
- Add build_git_protocol_error_response() to create HTTP 200 responses
with properly formatted ERR pkt-line ("ERR <message>\n")
- Add is_git_protocol_error() to detect protocol errors (exit code 128
with stderr content) vs transport errors
- Update handle_upload_pack() and handle_receive_pack() to return
protocol errors as HTTP 200 with ERR pkt-line
- Keep HTTP 500 for actual transport errors (spawn failures, I/O errors,
signals)
This allows git clients to properly parse and display protocol error
messages instead of seeing generic HTTP 500 errors.
Diffstat (limited to 'docs/how-to')
0 files changed, 0 insertions, 0 deletions