Bug: Set-Cookie values passed as a header are comma-joined into one invalid header on HTTP API and Function URL responses
I maintainer di solito rispondono entro 1 giorno
@saquibjawedbit ci sta già lavorando.
Dal 28/11/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
Direzione di ricerca
Inizia con HttpApiHeadersSerializer.serialize, che attualmente unisce con virgole le intestazioni con valori di lista, e riproduci il comportamento usando lo snippet APIGatewayHttpResolver fornito con apiGatewayProxyV2Event_GET.json. Aggiungi o aggiorna i test del serializer per coprire le intestazioni Set-Cookie senza distinzione tra maiuscole e minuscole e verifica che i valori vengano spostati nel campo cookies della risposta mentre le altre intestazioni rimangono invariate. Controlla anche il percorso equivalente di LambdaFunctionUrlResolver ed esegui la suite di test funzionale pertinente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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']
- Lingua principale
- Python
- Stelle
- 3.3k
- Fork
- 511
- Merge medio
- 2g 23h
- PR unite (30g)
- 50
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aws-powertools/powertools-lambda-python
-
Bug: CaseInsensitiveDict (event.headers) returns True for both == and != against the same mappingApertabug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
aws-powertools/powertools-lambda-python#8948 ·
I maintainer di solito rispondono entro 1 giorno
-
Docs: child Logger without a parent uses the root log level since #8842Forse già presa @rdxrahul12 l’ha presa oggi. Apertadocumentation triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
aws-powertools/powertools-lambda-python#8935 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: validate() raises raw jmespath ParseError instead of InvalidEnvelopeExpressionError for most malformed envelopesForse già presa @0x5t4l1n l’ha presa oggi. Apertabug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
aws-powertools/powertools-lambda-python#8918 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: SQSRecord.decoded_nested_sns_event raises KeyError on SNS messages delivered to SQSForse già presa @hyeonsang010716 l’ha presa 7 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
aws-powertools/powertools-lambda-python#8913 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: Metrics keeps dimensions and metadata from an invocation that added no metricsForse già presa @hyeonsang010716 l’ha presa 7 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
aws-powertools/powertools-lambda-python#8911 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di aws-powertools/powertools-lambda-python
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
litestar-org/sqlspec#946 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cli area:docs Platform vdr
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NVIDIA-NeMo/Gym#7192 ·
I maintainer di solito rispondono entro 2 giorni
-
SofyaBotAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
ai-robots-txt/ai.robots.txt#324 ·
-
[Resource]: DashbarApertaresource-submission validation-passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
hesreallyhim/awesome-claude-code#3821 · 1 commento ·
-
bug good first issue help wanted level 1 wocs
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
GianlucaBave/murmury#169 ·
I maintainer di solito rispondono entro 1 giorno