Skip to content

Commit 7016b66

Browse files
authored
Merge pull request #149 from DomainTools/IDEV-2028-bug-bash-changes
IDEV-2028: Bug bash changes
2 parents 11b1357 + d59dc97 commit 7016b66

File tree

6 files changed

+18728
-15
lines changed

6 files changed

+18728
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Custom parameters aside from the common `GET` Request parameters:
226226
api = API(USERNAME, KEY, always_sign_api_key=False)
227227
api.nod(endpoint="feed", **kwargs)
228228
```
229-
- `header_authentication`: by default, we're using API Header Authentication. Set this False if you want to use API Key and Secret Authentication. Apparently, you can't use API Header Authentication for `download` endpoints so you need to set this to `False` when calling `download` API endpoints.
229+
- `header_authentication`: by default, we're using API Header Authentication. Set this False if you want to use API Key and Secret Authentication. Apparently, you can't use API Header Authentication for `download` endpoints so this will be defaulted to `False` even without explicitly setting it.
230230
```python
231231
api = API(USERNAME, KEY, always_sign_api_key=False)
232232
api.nod(header_authentication=False, **kwargs)

domaintools/api.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,8 @@ def __init__(
8989

9090
if not https:
9191
raise Exception("The DomainTools API endpoints no longer support http traffic. Please make sure https=True.")
92-
if proxy_url:
93-
if isinstance(proxy_url, str):
94-
self.proxy_url = {"http://": proxy_url, "https://": proxy_url}
95-
else:
96-
raise Exception("Proxy URL must be a string. For example: '127.0.0.1:8888'")
92+
if proxy_url and not isinstance(proxy_url, str):
93+
raise Exception("Proxy URL must be a string. For example: '127.0.0.1:8888'")
9794

9895
def _build_api_url(self, api_url=None, api_port=None):
9996
"""Build the API url based on the given url and port. Defaults to `https://api.domaintools.com`"""

domaintools/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,5 @@ def validate_feeds_parameters(params):
185185
raise ValueError(f"{format} format is not available in {Endpoint.DOWNLOAD.value} API.")
186186

187187
if endpoint == Endpoint.DOWNLOAD.value and params.get("header_authentication", True):
188-
raise ValueError(f"{Endpoint.DOWNLOAD.value} API does not support header authentication. Provide api_key in the parameter")
188+
# For download endpoint, header_authentication will be False by default
189+
params["header_authentication"] = False

0 commit comments

Comments
 (0)