Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Bug] Redirects not being followed

Abierto
#744 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
api, backend

Línea de trabajo

Start by comparing the redirect handling around commit d9180bb and the client options used by GraphClientFactory.create_with_default_middleware. Reproduce the Microsoft Graph driveItem content request, trace why the 302 Location response is not followed despite RedirectHandlerOption, and verify that redirects are followed again with a regression test.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

A bug has been introduced in version 1.13.0 of microsoft-kiota-http: redirects aren't being followed correctly.

For example, to download a driveItem from the MS Graph API (docs link) you make a call to /drives/{drive-id}/items/{item-id}/content and get back an empty 302 Found response with the Location header set to the actual download URL.

The below is an extract of the httpx logs from version 1.13.0. You can see the Location header is successfully returned, but no redirect is made.

DEBUG [2026-09-21 08:53:37] httpcore.http11 - send_request_headers.started request=<Request [b'GET']>
DEBUG [2026-09-21 08:53:37] httpcore.http11 - send_request_headers.complete
DEBUG [2026-09-21 08:53:37] httpcore.http11 - send_request_body.started request=<Request [b'GET']>
DEBUG [2026-09-21 08:53:37] httpcore.http11 - send_request_body.complete
DEBUG [2026-09-21 08:53:37] httpcore.http11 - receive_response_headers.started request=<Request [b'GET']>
DEBUG [2026-09-21 08:53:37] httpcore.http11 - receive_response_headers.complete return_value=(b'HTTP/1.1', 302, b'Found', [(b'Cache-Control', b'no-store, no-cache'), (b'Content-Type', b'application/octet-stream'), (b'Location', b'<link to the download location>'), (b'Strict-Transport-Security', b'max-age=31536000'), (b'request-id', b'44de6ff3-71fc-42e6-ad10-9670be4fcb0d'), (b'client-request-id', b'44de6ff3-71fc-42e6-ad10-9670be4fcb0d'), (b'x-ms-ags-diagnostic', b'{"ServerInfo":{"DataCenter":"North Europe","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"DU2PEPF000107E5"}}'), (b'SPLogId', b'89553da2-e00b-3001-531f-268400ba5220'), (b'Date', b'Mon, 21 Sep 2026 08:53:37 GMT'), (b'Content-Length', b'0')])
INFO [2026-09-21 08:53:37] httpx - HTTP Request: GET https://graph.microsoft.com/v1.0//drives/<drive-id/items/<item-id>/content "HTTP/1.1 302 Found"
DEBUG [2026-09-21 08:53:37] httpcore.http11 - receive_response_body.started request=<Request [b'GET']>
DEBUG [2026-09-21 08:53:37] httpcore.http11 - receive_response_body.complete
DEBUG [2026-09-21 08:53:37] httpcore.http11 - response_closed.started
DEBUG [2026-09-21 08:53:37] httpcore.http11 - response_closed.complete
<END OF LOGS>

Even explicit setting the direct option when creating the various clients has no impact. i.e. if I do the following before making the call, the same error occurs.

auth_provider = AzureIdentityAuthenticationProvider(...)
client = GraphClientFactory.create_with_default_middleware(options=graph_request_adapter.options | {kioo.RedirectHandlerOption.get_key(): kioo.RedirectHandlerOption(should_redirect=True)})
adapter = msg.graph_request_adapter.GraphRequestAdapter(auth_provider, client=client)
ctx = msg.graph_service_client.GraphServiceClient(request_adapter=adapter)
...

I think this issue was caused by commit d9180bb. Tagging @rksharma-owg for visibility.

Lenguaje dominante
Python
Estrellas
31
Forks
39
Merge medio
16 h 37 min
PR fusionados (30 d)
42

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/kiota-python

Todos los issues de microsoft/kiota-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.