Repository navigation
fix(client): send minimal JSON body on empty POSTs to avoid HTTP 411 - #316
Merged
sethtroisi merged 1 commit intoDec 3, 2026
Merged
Conversation
sethtroisi
approved these changes
Dec 3, 2026
Collaborator
|
I'm surprised this happens but it's easy to fix so lets do it! Thanks @Milabo-HRH for seeing the issue and writing up this PR! |
doggy8088
added a commit
to doggy8088/google-colab-cli
that referenced
this pull request
Dec 4, 2026
上游變更:googlecolab#315 `colab stop` 端點備援(以伺服器端點停止孤兒分配,`_teardown` 失敗時保留本地記錄並提示重試)、googlecolab#316 空 POST 以最小 JSON 內文避免 HTTP 411。 更新譯文:docs/01_session_management.md、docs/05_run_command.md(log、端點備援說明、拆除流程與測試案例)。 其餘檔案隨 main 鏡像;常駐偏離 .github/workflows/pages.yml、scripts/build_site.py 保留。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #299.
Problem
POST /tun/m/assignandPOST /tun/m/unassignissue body-less POST requests viaClient._issue_request. On some networks / Google Frontend edges, empty POST requests are rejected withHTTP 411 Length Required(POST requests require a Content-length header), even whenrequestsemitsContent-Length: 0.Fix
In
Client._issue_request, whenmethod.upper() == "POST"and no request body (data,json, orfiles) is provided, default todata=b"{}". Callers that pass an explicit body and non-POST requests are untouched.Testing
tests/test_client.pycovering body-less POSTs (includingassignandunassign), preservation of explicitdata/jsonpayloads, and unchanged GET requests.ruff format --check src/colab_cli/client.py tests/test_client.py-> clean.pytest -q tests-> 681 passed, 27 skipped (excluding the headless D-BusSecretServicetest in WSL).