Bug: Cookie with SameSite.DEFAULT_MODE sends an empty SameSite= attribute
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Expected Behaviour
Cookie(..., same_site=SameSite.DEFAULT_MODE) leaves the SameSite attribute out of the Set-Cookie header, so the browser applies its default (the same as Go's http.SameSiteDefaultMode, which these names follow).
Current Behaviour
Cookie.__str__ checks if self.same_site:, which is true for every enum member, and DEFAULT_MODE has the value "", so the header gets an attribute with no value: SameSite=. That is not a valid SameSite value.
Code snippet
from aws_lambda_powertools.shared.cookies import Cookie, SameSite
str(Cookie(name="session", value="abc", same_site=SameSite.DEFAULT_MODE))
# 'session=abc; Secure; SameSite='
Steps to Reproduce
- Create a
Cookiewithsame_site=SameSite.DEFAULT_MODE. - Return it in a
Response(cookies=[...])or callstr()on it. - The
Set-Cookievalue ends withSameSite=.
Possible Solution
Only write the attribute when the enum value is not empty. I can open a PR.
Powertools for AWS Lambda (Python) version
latest (develop, 3.38.0)
AWS Lambda function runtime
3.12
Packaging format used
PyPi
Debugging logs
No response
- Lenguaje dominante
- Python
- Estrellas
- 3.3k
- Forks
- 511
- Merge medio
- 3 d 8 h
- PR fusionados (30 d)
- 92
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: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocationPosiblemente ocupada @lechakrawarthy la tomó hace 1 día. Abiertobug good first issue help wanted idempotency
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
aws-powertools/powertools-lambda-python#8728 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Bug: Redis layer fails the invocation instead of retrying when a record expires between SET NX and GETPosiblemente ocupada @coughlmao la tomó hace 1 día. Abiertobug good first issue help wanted idempotency
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
aws-powertools/powertools-lambda-python#8727 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Bug: Redis orphan lock timeout ignores expires_after_seconds and is always 10 secondsPosiblemente ocupada @CJstate la tomó hace 1 día. Abiertobug good first issue help wanted idempotency
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
aws-powertools/powertools-lambda-python#8726 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Bug: idempotency payloads with set, frozenset or bytes fields cannot be hashedPosiblemente ocupada @Neeraj111010 la tomó hace 1 día. Abiertobug good first issue help wanted idempotency
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
aws-powertools/powertools-lambda-python#8725 · 6 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Bug: with a DynamoDB composite key, DataRecord.idempotency_key is the static partition key valuePosiblemente ocupada @sumedh-aerram la tomó hace 1 día. Abiertobug good first issue help wanted idempotency
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
aws-powertools/powertools-lambda-python#8724 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de aws-powertools/powertools-lambda-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
earthtojake/text-to-cad#758 ·
Los mantenedores suelen responder en 1 día
-
domain:upgrades enhancement needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
gke-labs/kube-agents#4634 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
agardnerIT/opamp-server-py#116 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
elviskahoro/sdk-python-attio#144 · 1 comentario ·
Los mantenedores suelen responder en 1 día