[PR #394] [CLOSED] Unrecognized case sensitive headers during auth #606

Closed
opened 2026-02-27 23:01:40 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/sigma67/ytmusicapi/pull/394
Author: @czifumasa
Created: 5/18/2023
Status: Closed

Base: masterHead: case_sensitive_auth


📝 Commits (1)

  • 145bd2d Fixed unrecognized case sensitive headers during auth

📊 Changes

2 files changed (+2 additions, -2 deletions)

View changed files

📝 ytmusicapi/auth/browser.py (+1 -1)
📝 ytmusicapi/auth/oauth.py (+1 -1)

📄 Description

Browser authentication doesn't work when I copy request headers from Chrome.
The reason is request headers are Capitalized in Chrome.

From CaseInsensitiveDict docs:
All keys are expected to be strings. The structure remembers the case of the last key to be set, and ``iter(instance)``, ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` will contain case-sensitive keys. However, querying and contains testing is case insensitive::

With that in mind I replaced "headers.keys()" method with better check and now check for request headers should be case insensitive.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/sigma67/ytmusicapi/pull/394 **Author:** [@czifumasa](https://github.com/czifumasa) **Created:** 5/18/2023 **Status:** ❌ Closed **Base:** `master` ← **Head:** `case_sensitive_auth` --- ### 📝 Commits (1) - [`145bd2d`](https://github.com/sigma67/ytmusicapi/commit/145bd2d5e63a2f0ae823eea0180f4cb29244231c) Fixed unrecognized case sensitive headers during auth ### 📊 Changes **2 files changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `ytmusicapi/auth/browser.py` (+1 -1) 📝 `ytmusicapi/auth/oauth.py` (+1 -1) </details> ### 📄 Description Browser authentication doesn't work when I copy request headers from Chrome. The reason is request headers are Capitalized in Chrome. From [CaseInsensitiveDict](https://requests.readthedocs.io/projects/cn/zh_CN/latest/_modules/requests/structures.html) docs: `All keys are expected to be strings. The structure remembers the case of the last key to be set, and ``iter(instance)``, ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` will contain case-sensitive keys. However, querying and contains testing is case insensitive::` With that in mind I replaced "headers.keys()" method with better check and now check for request headers should be case insensitive. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 23:01:40 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#606
No description provided.