Skip to content

Fix Smart HTTP push framing - #442

Merged
genedna merged 1 commit into
libra-tools:mainfrom
Ivanbeethoven:agent/fix-smart-http-push-framing
Jul 22, 2026
Merged

Fix Smart HTTP push framing#442
genedna merged 1 commit into
libra-tools:mainfrom
Ivanbeethoven:agent/fix-smart-http-push-framing

Conversation

@Ivanbeethoven

Copy link
Copy Markdown
Collaborator

What changed

  • send Git-compatible Accept and User-Agent headers for Smart HTTP receive-pack requests
  • use a concrete Bytes request body and set its exact Content-Length
  • preserve retryable request bodies across Basic authentication attempts

Why

Some Git-compatible gateways reject or proxy-fail Libra receive-pack POSTs when the request framing differs from native Git. Against a mega deployment this surfaced as 502 Bad Gateway, while native git push succeeded.

Impact

Libra Smart HTTP pushes now use deterministic request framing and headers compatible with native Git receive-pack endpoints.

Validation

  • cargo fmt --check
  • built Libra 0.19.40 locally under WSL
  • verified a Libra Smart HTTP push reached mega receive-pack successfully instead of returning 502
  • verified the full push advanced to mega's repository policy/object-storage processing; remaining failures were server-side RustFS/S3 PUT errors

@Ivanbeethoven
Ivanbeethoven marked this pull request as ready for review July 22, 2026 05:52
@genedna
genedna merged commit 9209b9f into libra-tools:main Jul 22, 2026
3 of 9 checks passed
genedna added a commit to Ivanbeethoven/libra that referenced this pull request Aug 8, 2026
Resolve the src/internal/auth.rs conflict in favour of main. Both fixes
this branch carried have already landed upstream independently:

- the Smart HTTP push framing change (bytes::Bytes body plus Accept,
  User-Agent and Content-Length headers) merged as 9209b9f via libra-tools#442;
- HostScope::from_request_url was fixed on main by 1239bbd, which drops
  straight to scope_of instead of normalizing the URL to its origin first.
  The two spellings are behaviourally identical — this branch set the path
  to "/" and cleared query/fragment so that from_url's refusals became
  no-ops before it delegated to scope_of — so main's simpler form is kept.

The merged tree is byte-identical to origin/main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants