Skip to content

Commit

Permalink
Fix cookie parsing (#123)
Browse files Browse the repository at this point in the history
- Fix cookie parsing so that it works when cookies are provided by
extensions such as `Cookies-Editor`
  • Loading branch information
vsakkas authored Nov 26, 2023
1 parent 3603e4c commit 4fe40f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <img src="https://raw.githubusercontent.com/vsakkas/sydney.py/master/images/logo.svg" width="28px" /> Sydney.py

[![Latest Release](https://img.shields.io/github/v/release/vsakkas/sydney.py.svg)](https://github.com/vsakkas/sydney.py/releases/tag/v0.18.0)
[![Latest Release](https://img.shields.io/github/v/release/vsakkas/sydney.py.svg)](https://github.com/vsakkas/sydney.py/releases/tag/v0.18.1)
[![Python](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![MIT License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/vsakkas/sydney.py/blob/master/LICENSE)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sydney-py"
version = "0.18.0"
version = "0.18.1"
description = "Python Client for Copilot (formerly named Bing Chat), also known as Sydney."
authors = ["vsakkas <[email protected]>"]
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions sydney/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ def cookies_as_dict(cookies: str) -> dict:
Convert a string of cookies into a dictionary.
"""
return {
key_value.split("=")[0]: "=".join(key_value.split("=")[1:])
for key_value in cookies.split("; ")
key_value.strip().split("=")[0]: "=".join(key_value.split("=")[1:])
for key_value in cookies.split(";")
}

0 comments on commit 4fe40f9

Please sign in to comment.