Skip to content

Commit b50794c

Browse files
committed
refactor(destination): remove unnecessary type validation and unused field in DestinationHttpClient
1 parent 175f177 commit b50794c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/sap_cloud_sdk/destination/_destination_http_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,19 @@ class DestinationHttpClient:
1616
Pre-bakes headers derived from the destination — ERP headers (sap-client,
1717
sap-language), URL.headers.* properties, and auth tokens.
1818
19-
Usage::
19+
Usage:
2020
2121
dest = client.get_destination("my-erp")
2222
http = DestinationHttpClient(dest)
2323
response = http.request("GET", "/api/resource")
2424
"""
2525

2626
def __init__(self, destination: Destination) -> None:
27-
if destination.type not in (DestinationType.HTTP, "HTTP"):
27+
if destination.type != DestinationType.HTTP:
2828
raise ValueError(
2929
f"DestinationHttpClient only supports HTTP destinations, got: {destination.type}"
3030
)
3131

32-
self._destination = destination
3332
self._session = requests.Session()
3433
self._session.headers.update(destination.get_headers())
3534
self._base_url = destination.url.rstrip("/") if destination.url else ""

0 commit comments

Comments
 (0)