getsentry / getsentry/sentry-python

Add `Keep-Alive` header if `keep_alive` is on

Đang mở
#3,532 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Component: Transport Improvement Python Quality Improvement
Ngôn ngữ chính
Python
Star
2.2k
Fork
669
Merge trung bình
1 ngày 1 giờ
Pull request đã merge (30 ngày)
213

Mô tả

If `keep_alive` is set to `True`, we currently set [a bunch of TCP socket options](https://github.com/getsentry/sentry-python/blob/e6ca5a28dd139097ad7c8cb468e0b9232185b728/sentry_sdk/transport.py#L41-L52). There are also respective HTTP [headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Connection_management_in_HTTP_1.x#persistent_connections) ([`Connection`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection) and [`Keep-Alive`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive)) that we don't set.

Apparently HTTP/1.1 [keeps](https://developer.mozilla.org/en-US/docs/Web/HTTP/Connection_management_in_HTTP_1.x#persistent_connections) connections open by default and the `Connection` header is not needed. However, a reasonable `Keep-Alive` that is in line with the timeout in the socket options would be good to add.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.