diff --git a/linkedin_messaging/linkedin.py b/linkedin_messaging/linkedin.py index 5678291..3ee52df 100644 --- a/linkedin_messaging/linkedin.py +++ b/linkedin_messaging/linkedin.py @@ -158,9 +158,9 @@ def from_cookies_and_headers(cookies: dict[str, str], # Skip these headers, including them will result in events being received in a newer # format that we don't support - del linkedin.headers["x-li-query-map"] - del linkedin.headers["x-li-query-accept"] - del linkedin.headers["x-li-accept"] + linkedin.headers.pop("x-li-query-map", None) + linkedin.headers.pop("x-li-query-accept", None) + linkedin.headers.pop("x-li-accept", None) return linkedin