append_log_content returns HTTP 400 (Content-Length not set)
還沒有人認領這個 Issue。
評估
研究方向
從 issue 中所示的 append_log_content 進入點開始,檢查其 _send 呼叫如何為 application/octet-stream 內容建構標頭。重現 Azure DevOps Server 2020 請求,然後確認該請求包含 Content-Length,且不再回傳 HTTP 400。
由索引模型根據 Issue 內容生成。
描述
When using append_log_content, it returns HTTP 400 status code, and '{"count":55,"value":"ContentLength header must be specified to create a log."}'
DevOps: Azure DevOps Server 2020 update 1.1
azure-devops-python-api: 6.0.0b4
I workaround it with an explicit Content-Length header:
def append_log_content(self, content, scope_identifier, hub_name, plan_id, log_id):
"""AppendLogContent.
:param bytes content: The content to be append
:param str scope_identifier: The project GUID to scope the request
:param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server
:param str plan_id:
:param int log_id:
:rtype: :class:`<TaskLog> <azure.devops.v5_1.task.models.TaskLog>`
"""
route_values = {}
if scope_identifier is not None:
route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str')
if hub_name is not None:
route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str')
if log_id is not None:
route_values['logId'] = self._serialize.url('log_id', log_id, 'int')
response = self._send(http_method='POST',
location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2',
version='5.1',
route_values=route_values,
content=content,
media_type='application/octet-stream',
additional_headers={"Content-Length": len(content)})
return self._deserialize('TaskLog', response)
- 主要語言
- Python
- 星號
- 684
- 分支
- 218
- 平均合併
- 8 天 10 小時
- 30 天內合併 PR
- 1
環境準備
我們還沒有檢查這個專案的環境設定檔。先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/azure-devops-python-api 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 55/100
-
難度 5/5 一週以上 新手友好度 25/100
-
難度 1/5 1 小時以內 新手友好度 55/100
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 3/5 1-2 天 新手友好度 45/100
查看 microsoft/azure-devops-python-api 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
gradio-app/gradio#13895 ·
維護者通常 1 天內回覆
-
build-error
難度 2/5 1-3 小時 新手友好度 76/100
spack/spack-packages#6713 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
ActivityWatch/activitywatch#1464 · 1 個 reaction ·
維護者通常 1 天內回覆
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search results未關閉
難度 2/5 1-3 小時 新手友好度 78/100
bytedance/trae-agent#483 ·
維護者通常 1 天內回覆