aio-libs / aiohttp-sse

Server-sent events support for aiohttp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add EventSourceResponse.last_event_id

decaz opened this issue · comments

I think it would be useful to add last_event_id property to the EventSourceResponse class from the example:

@property
def last_event_id(self):
return self._req.headers.get("Last-Event-Id")

Also there is a bug at that example (sse_response doesn't accept response_cls parameter):

stream = await sse_response(request, response_cls=SSEResponse)

Would you like to create PR with a fix?

The fix is already in master. Somebody mighty needs to release 2.2.0.
Until then as a "workaround" I directly install from github instead of PyPI