Skip to content

Commit

Permalink
fix whitespace sensitive content-type (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
blueridanus authored May 6, 2024
1 parent f93fbdc commit b0a731a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions requests_sse/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
DEFAULT_RECONNECTION_TIME = timedelta(seconds=5)
DEFAULT_MAX_CONNECT_RETRY = 5
_CONTENT_TYPE_EVENT_STREAM = "text/event-stream"
_CONTENT_TYPE_EVENT_STREAM_UTF_8 = "text/event-stream; charset=utf-8"
_CONTENT_TYPE_EVENT_STREAM_UTF_8 = "text/event-stream;charset=utf-8"
_LOGGER = logging.getLogger(__name__)


Expand Down Expand Up @@ -279,7 +279,7 @@ def connect(self, retry: int = 0) -> None:
)

content_type = response.headers.get("Content-Type")
if not content_type or content_type.lower() not in (
if not content_type or content_type.lower().replace(" ", "") not in (
_CONTENT_TYPE_EVENT_STREAM,
_CONTENT_TYPE_EVENT_STREAM_UTF_8,
):
Expand Down

0 comments on commit b0a731a

Please sign in to comment.