Bug: Set-Cookie values passed as a header are comma-joined into one invalid header on HTTP API and Function URL responses
Los mantenedores suelen responder en 1 día
@saquibjawedbit ya está trabajando en esto.
Desde el 28/11/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
Línea de trabajo
Comienza con HttpApiHeadersSerializer.serialize, que actualmente une mediante comas los headers con valores de lista, y reproduce el comportamiento usando el fragmento APIGatewayHttpResolver proporcionado con apiGatewayProxyV2Event_GET.json. Añade o actualiza las pruebas del serializer para cubrir los headers Set-Cookie sin distinguir entre mayúsculas y minúsculas, y verifica que los valores se muevan al campo cookies de la respuesta mientras que los demás headers permanecen sin cambios. Comprueba también la ruta equivalente de LambdaFunctionUrlResolver y ejecuta la suite de pruebas funcionales relevante.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Expected Behaviour
When a route returns Response(headers={"Set-Cookie": [...]}) with APIGatewayHttpResolver or LambdaFunctionUrlResolver, each value should reach the client as its own Set-Cookie header, the same as passing them through cookies=. Payload format 2.0 has no multi-value headers, so the values belong in the response cookies field.
Current Behaviour
HttpApiHeadersSerializer joins every list header with ", ", including Set-Cookie. The client gets one header such as session=abc; Expires=Wed, 21 Oct 2026 07:28:00 GMT, theme=dark, which browsers read as a single cookie, so the second cookie is lost and the first gets a broken Expires. Set-Cookie cannot be comma-joined (RFC 6265 section 3); the REST/ALB multi-value serializer already sends them separately.
Code snippet
from aws_lambda_powertools.event_handler import APIGatewayHttpResolver, Response
from aws_lambda_powertools.shared.cookies import Cookie
from tests.functional.utils import load_event
app = APIGatewayHttpResolver()
@app.get("/my/path")
def handler():
return Response(
200,
"text/plain",
"ok",
headers={"Set-Cookie": ["session=abc; Expires=Wed, 21 Oct 2026 07:28:00 GMT", "theme=dark"]},
cookies=[Cookie("lang", "en")],
)
result = app.resolve(load_event("apiGatewayProxyV2Event_GET.json"), None)
print(result["headers"])
print(result["cookies"])
Possible Solution
In HttpApiHeadersSerializer.serialize, treat a Set-Cookie header (any casing) as cookies: append its values to the cookies list instead of joining them into headers. Other headers are unchanged.
Steps to Reproduce
- On
develop(0bbc252), run the snippet above. headers["Set-Cookie"]is'session=abc; Expires=Wed, 21 Oct 2026 07:28:00 GMT, theme=dark'andcookiesonly haslang=en; Secure.
Did you run the reproduction yourself?
Yes, I ran it and saw the failure
Powertools for AWS Lambda (Python) version
3.41.0 (develop @ 0bbc252)
AWS Lambda function runtime
3.13
Packaging format used
PyPi
Debugging logs
{'Set-Cookie': 'session=abc; Expires=Wed, 21 Oct 2026 07:28:00 GMT, theme=dark', 'Content-Type': 'text/plain'}
['lang=en; Secure']
- Lenguaje dominante
- Python
- Estrellas
- 3.3k
- Forks
- 511
- Merge medio
- 2 d 23 h
- PR fusionados (30 d)
- 50
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws-powertools/powertools-lambda-python
-
Bug: CaseInsensitiveDict (event.headers) returns True for both == and != against the same mappingAbiertobug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
aws-powertools/powertools-lambda-python#8948 ·
Los mantenedores suelen responder en 1 día
-
Docs: child Logger without a parent uses the root log level since #8842Posiblemente ocupada @rdxrahul12 la tomó hoy. Abiertodocumentation triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
aws-powertools/powertools-lambda-python#8935 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Bug: validate() raises raw jmespath ParseError instead of InvalidEnvelopeExpressionError for most malformed envelopesPosiblemente ocupada @0x5t4l1n la tomó hoy. Abiertobug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
aws-powertools/powertools-lambda-python#8918 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Bug: SQSRecord.decoded_nested_sns_event raises KeyError on SNS messages delivered to SQSPosiblemente ocupada @hyeonsang010716 la tomó hace 7 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
aws-powertools/powertools-lambda-python#8913 ·
Los mantenedores suelen responder en 1 día
-
Bug: Metrics keeps dimensions and metadata from an invocation that added no metricsPosiblemente ocupada @hyeonsang010716 la tomó hace 7 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
aws-powertools/powertools-lambda-python#8911 ·
Los mantenedores suelen responder en 1 día
Todos los issues de aws-powertools/powertools-lambda-python
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
litestar-org/sqlspec#946 ·
Los mantenedores suelen responder en 1 día
-
area:cli area:docs Platform vdr
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA-NeMo/Gym#7192 ·
Los mantenedores suelen responder en 2 días
-
SofyaBotAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
ai-robots-txt/ai.robots.txt#324 ·
-
[Resource]: DashbarAbiertoresource-submission validation-passed
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
hesreallyhim/awesome-claude-code#3821 · 1 comentario ·
-
bug good first issue help wanted level 1 wocs
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
GianlucaBave/murmury#169 ·
Los mantenedores suelen responder en 1 día