microsoft / microsoft/azure-devops-python-api
append_log_content returns HTTP 400 (Content-Length not set)
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 684
- Forks
- 218
- Ø Merge
- 8 T. 10 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
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)
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie beim im Issue gezeigten Einstiegspunkt append_log_content und untersuchen Sie, wie sein _send-Aufruf Header für Inhalte des Typs application/octet-stream erstellt. Reproduzieren Sie die Anfrage an Azure DevOps Server 2020 und überprüfen Sie anschließend, dass die Anfrage Content-Length enthält und nicht mehr HTTP 400 zurückgibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- azure, python
- Bereich
- api
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100