Skip to content

Add Plash header #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add Plash header #10

wants to merge 2 commits into from

Conversation

pydanny
Copy link
Contributor

@pydanny pydanny commented Apr 24, 2025

Adds a header so for requests to Plash we can have client-based responses. For example, a web browser request will be different than a CLI request.

@@ -27,6 +27,7 @@ def get_client(cookie_file):
raise FileNotFoundError("Plash config not found. Please run plash_login and try again.")
cookies = Path(cookie_file).read_json()
client.cookies.update(cookies)
client.headers.update({'X-PLASH': True})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm just wondering if we could also set this serverside so that it's automatically caught when the cookies are read here. And if that would be better because then we set the cookies in one place instead of two. So it will be easier to reason about what the cookies are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants