Skip to content

Commit

Permalink
Complete header match
Browse files Browse the repository at this point in the history
  • Loading branch information
mkmer committed Jan 9, 2024
1 parent b02f3f2 commit dc03f76
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions blinkpy/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from blinkpy.helpers import util
from blinkpy.helpers.constants import (
BLINK_URL,
APP_BUILD,
DEFAULT_USER_AGENT,
LOGIN_ENDPOINT,
TIMEOUT,
Expand Down Expand Up @@ -64,9 +65,10 @@ def header(self):
if self.token is None:
return None
return {
"APP-BUILD": APP_BUILD,
"TOKEN_AUTH": self.token,
"user-agent": DEFAULT_USER_AGENT,
"content-type": "application/json",
"User-Agent": DEFAULT_USER_AGENT,
"Content-Type": "application/json",
}

def validate_login(self):
Expand Down
2 changes: 1 addition & 1 deletion blinkpy/helpers/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"""
OTHER
"""

APP_BUILD = "ANDROID_28373244"
DEFAULT_USER_AGENT = "27.0ANDROID_28373244"
DEVICE_ID = "Blinkpy"
TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
Expand Down
5 changes: 3 additions & 2 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ def test_header(self):
"""Test header data."""
self.auth.token = "bar"
expected_header = {
"APP-BUILD": const.APP_BUILD,
"TOKEN_AUTH": "bar",
"user-agent": const.DEFAULT_USER_AGENT,
"content-type": "application/json",
"User-Agent": const.DEFAULT_USER_AGENT,
"Content-Type": "application/json",
}
self.assertDictEqual(self.auth.header, expected_header)

Expand Down

0 comments on commit dc03f76

Please sign in to comment.