Skip to content

Commit

Permalink
fix: drop x prefix (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored Feb 5, 2025
1 parent 6799788 commit 1726b90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions UnleashClient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ def initialize_client(self, fetch_toggles: bool = True) -> None:
try:
headers = {
**self.unleash_custom_headers,
"x-unleash-connection-id": str(uuid.uuid4()),
"x-unleash-appname": self.unleash_app_name,
"x-unleash-sdk": f"{SDK_NAME}:{SDK_VERSION}",
"unleash-connection-id": str(uuid.uuid4()),
"unleash-appname": self.unleash_app_name,
"unleash-sdk": f"{SDK_NAME}:{SDK_VERSION}",
}

# Setup
Expand Down
16 changes: 8 additions & 8 deletions tests/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,14 +1043,14 @@ def test_identification_headers_sent_and_consistent(unleash_client):
responses.add(responses.POST, URL + METRICS_URL, json={}, status=202)
unleash_client.initialize_client()

connection_id = responses.calls[0].request.headers["X-UNLEASH-CONNECTION-ID"]
app_name = responses.calls[0].request.headers["X-UNLEASH-APPNAME"]
sdk = responses.calls[0].request.headers["X-UNLEASH-SDK"]
connection_id = responses.calls[0].request.headers["UNLEASH-CONNECTION-ID"]
app_name = responses.calls[0].request.headers["UNLEASH-APPNAME"]
sdk = responses.calls[0].request.headers["UNLEASH-SDK"]

for api_call in responses.calls:
assert api_call.request.headers["X-UNLEASH-CONNECTION-ID"] == connection_id
assert api_call.request.headers["X-UNLEASH-APPNAME"] == app_name
assert api_call.request.headers["X-UNLEASH-SDK"] == sdk
assert api_call.request.headers["UNLEASH-CONNECTION-ID"] == connection_id
assert api_call.request.headers["UNLEASH-APPNAME"] == app_name
assert api_call.request.headers["UNLEASH-SDK"] == sdk


@responses.activate
Expand All @@ -1066,7 +1066,7 @@ def test_identification_headers_unique_connection_id():
)
unleash_client.initialize_client()
connection_id_first_client = responses.calls[0].request.headers[
"X-UNLEASH-CONNECTION-ID"
"UNLEASH-CONNECTION-ID"
]

other_unleash_client = UnleashClient(
Expand All @@ -1075,6 +1075,6 @@ def test_identification_headers_unique_connection_id():
other_unleash_client.initialize_client()

connection_id_second_client = responses.calls[1].request.headers[
"X-UNLEASH-CONNECTION-ID"
"UNLEASH-CONNECTION-ID"
]
assert connection_id_first_client != connection_id_second_client

0 comments on commit 1726b90

Please sign in to comment.