Bug: Cookie with SameSite.DEFAULT_MODE sends an empty SameSite= attribute
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 3.3k
- Fork
- 511
- Merge trung bình
- 3 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 93
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws-powertools/powertools-lambda-python
-
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocationCó thể đã có người làm @lechakrawarthy đã nhận hôm nay. Đang mởbug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
aws-powertools/powertools-lambda-python#8728 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
aws-powertools/powertools-lambda-python#8727 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
aws-powertools/powertools-lambda-python#8726 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
aws-powertools/powertools-lambda-python#8725 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Bug: with a DynamoDB composite key, DataRecord.idempotency_key is the static partition key valueCó thể đã có người làm @sumedh-aerram đã nhận hôm nay. Đang mởbug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
aws-powertools/powertools-lambda-python#8724 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của aws-powertools/powertools-lambda-python
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
Imbad0202/academic-research-skills#1039 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
alexgreensh/token-optimizer#297 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
superdesigndev/treg#1343 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GitHub handle should allow underscoresCó thể đã có người làm @PrakarshSrivastav đã nhận hôm nay. Đang mởbug good-first-issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nf-core/tools#4581 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
ANCORATE/EncryptHome#8 ·