Skip to content

Commit 1726b90

Browse files
authored
fix: drop x prefix (#343)
1 parent 6799788 commit 1726b90

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

UnleashClient/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ def initialize_client(self, fetch_toggles: bool = True) -> None:
215215
try:
216216
headers = {
217217
**self.unleash_custom_headers,
218-
"x-unleash-connection-id": str(uuid.uuid4()),
219-
"x-unleash-appname": self.unleash_app_name,
220-
"x-unleash-sdk": f"{SDK_NAME}:{SDK_VERSION}",
218+
"unleash-connection-id": str(uuid.uuid4()),
219+
"unleash-appname": self.unleash_app_name,
220+
"unleash-sdk": f"{SDK_NAME}:{SDK_VERSION}",
221221
}
222222

223223
# Setup

tests/unit_tests/test_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,14 +1043,14 @@ def test_identification_headers_sent_and_consistent(unleash_client):
10431043
responses.add(responses.POST, URL + METRICS_URL, json={}, status=202)
10441044
unleash_client.initialize_client()
10451045

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

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

10551055

10561056
@responses.activate
@@ -1066,7 +1066,7 @@ def test_identification_headers_unique_connection_id():
10661066
)
10671067
unleash_client.initialize_client()
10681068
connection_id_first_client = responses.calls[0].request.headers[
1069-
"X-UNLEASH-CONNECTION-ID"
1069+
"UNLEASH-CONNECTION-ID"
10701070
]
10711071

10721072
other_unleash_client = UnleashClient(
@@ -1075,6 +1075,6 @@ def test_identification_headers_unique_connection_id():
10751075
other_unleash_client.initialize_client()
10761076

10771077
connection_id_second_client = responses.calls[1].request.headers[
1078-
"X-UNLEASH-CONNECTION-ID"
1078+
"UNLEASH-CONNECTION-ID"
10791079
]
10801080
assert connection_id_first_client != connection_id_second_client

0 commit comments

Comments
 (0)