mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 10:16:27 +00:00
Updated typing for WebsocketMessage.content
This commit is contained in:
parent
fd4379aa2c
commit
2bb5f7b973
@ -4,6 +4,7 @@ Unreleased: mitmproxy next
|
||||
|
||||
* Add MsgPack content viewer (@tasn)
|
||||
* Fix links to anticache docs in mitmweb and use HTTPS for links to documentation (@rugk)
|
||||
* Updated typing for WebsocketMessage.content (@prinzhorn)
|
||||
|
||||
* --- TODO: add new PRs above this line ---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import time
|
||||
import queue
|
||||
from typing import List, Optional
|
||||
from typing import List, Optional, Union
|
||||
|
||||
from wsproto.frame_protocol import CloseReason
|
||||
from wsproto.frame_protocol import Opcode
|
||||
@ -17,7 +17,7 @@ class WebSocketMessage(serializable.Serializable):
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self, type: int, from_client: bool, content: bytes, timestamp: Optional[float]=None, killed: bool=False
|
||||
self, type: int, from_client: bool, content: Union[bytes, str], timestamp: Optional[float]=None, killed: bool=False
|
||||
) -> None:
|
||||
self.type = Opcode(type) # type: ignore
|
||||
"""indicates either TEXT or BINARY (from wsproto.frame_protocol.Opcode)."""
|
||||
|
Loading…
Reference in New Issue
Block a user