mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-15 21:02:07 +00:00
[PR #104] [MERGED] fix(stream): version-gate multiplexed Content-Type and apply to exec-start #104
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/LXC2Docker#104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/LXC2Docker/pull/104
Author: @JBailes
Created: 7/1/2026
Status: ✅ Merged
Merged: 7/1/2026
Merged by: @JBailes
Base:
main← Head:fix/multiplexed-stream-version-gate📝 Commits (1)
89f73d9fix(stream): version-gate multiplexed Content-Type and apply to exec-start📊 Changes
3 files changed (+115 additions, -40 deletions)
View changed files
📝
internal/api/attach_response_test.go(+55 -16)📝
internal/api/containers.go(+56 -14)📝
internal/api/exec.go(+4 -10)📄 Description
Byte-exact follow-ups from the #103 roundtable review, covering the two remaining stream-Content-Type parity gaps.
1. Version-gate the multiplexed media type
moby advertises the multiplexed stream type only for
!Tty && version >= 1.42; the type was introduced in API v1.42, so a client that negotiated an older version predates it and must getraw-stream(it demuxes fromConfig.Tty, not the header). #103 advertisedmultiplexed-streamunconditionally.streamContentType(r, tty)now consults the client's negotiated API version from the/v{version}/path prefix (absent = current daemon = multiplexed-eligible) via newapiVersionAtLeast/compareDottedVersionshelpers (numeric compare, so1.9 < 1.10).2. Apply the shared helper to exec-start
POST /exec/{id}/startstill hardcodedraw-streamin both hijack branches, even though non-TTY exec streams stdcopy-multiplexed frames (runExecMux) — the same Content-Type/framing mismatch #103 fixed for attach/logs. It now routes throughwriteHijackPreamble+streamContentType(r, rec.Tty), so exec advertises the correct (version-gated) media type. The 101-vs-200 behavior from #98 is unchanged.After this PR all four stream sites — attach, logs (×2), exec-start — resolve the media type through one helper.
Tests
internal/api/attach_response_test.go:streamContentTypeacross version × tty (no-version, 1.24/1.41 → raw, 1.42/1.43/1.50 → multiplexed, tty always raw).compareDottedVersionsincl. the numeric-not-lexicographic case (1.9vs1.10).writeHijackPreambleupdated for the new(w, upgrade, contentType)signature.Full
go test ./...,go vet,gofmtclean locally.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.