Bug: Set-Cookie values passed as a header are comma-joined into one invalid header on HTTP API and Function URL responses
Mantenedores costumam responder em até 1 dia
@saquibjawedbit já está trabalhando nisso.
Desde 28/11/2026.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 85/100
Direção de pesquisa
Comece com HttpApiHeadersSerializer.serialize, que atualmente une por vírgulas os cabeçalhos com valores de lista, e reproduza o comportamento usando o trecho APIGatewayHttpResolver fornecido com apiGatewayProxyV2Event_GET.json. Adicione ou atualize os testes do serializer para cobrir os cabeçalhos Set-Cookie sem diferenciar maiúsculas de minúsculas e verifique se os valores são movidos para o campo cookies da resposta enquanto os demais cabeçalhos permanecem inalterados. Verifique também o caminho equivalente de LambdaFunctionUrlResolver e execute a suíte de testes funcionais relevante.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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']
- Linguagem predominante
- Python
- Estrelas
- 3.3k
- Forks
- 511
- Merge médio
- 2d 23h
- PRs com merge (30d)
- 50
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de aws-powertools/powertools-lambda-python
-
Bug: CaseInsensitiveDict (event.headers) returns True for both == and != against the same mappingAbertabug triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
aws-powertools/powertools-lambda-python#8948 ·
Mantenedores costumam responder em até 1 dia
-
Docs: child Logger without a parent uses the root log level since #8842Talvez já em andamento @rdxrahul12 assumiu hoje. Abertadocumentation triage
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 85/100
aws-powertools/powertools-lambda-python#8935 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Bug: validate() raises raw jmespath ParseError instead of InvalidEnvelopeExpressionError for most malformed envelopesTalvez já em andamento @0x5t4l1n assumiu hoje. Abertabug triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
aws-powertools/powertools-lambda-python#8918 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Bug: SQSRecord.decoded_nested_sns_event raises KeyError on SNS messages delivered to SQSTalvez já em andamento @hyeonsang010716 assumiu há 7 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
aws-powertools/powertools-lambda-python#8913 ·
Mantenedores costumam responder em até 1 dia
-
Bug: Metrics keeps dimensions and metadata from an invocation that added no metricsTalvez já em andamento @hyeonsang010716 assumiu há 7 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
aws-powertools/powertools-lambda-python#8911 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de aws-powertools/powertools-lambda-python
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
litestar-org/sqlspec#946 ·
Mantenedores costumam responder em até 1 dia
-
area:cli area:docs Platform vdr
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
NVIDIA-NeMo/Gym#7192 ·
Mantenedores costumam responder em até 2 dias
-
SofyaBotAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
ai-robots-txt/ai.robots.txt#324 ·
-
[Resource]: DashbarAbertaresource-submission validation-passed
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
hesreallyhim/awesome-claude-code#3821 · 1 comentário ·
-
bug good first issue help wanted level 1 wocs
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 92/100
GianlucaBave/murmury#169 ·
Mantenedores costumam responder em até 1 dia