Skip to content

Commit

Permalink
Added validation of "host" attribute (#20)
Browse files Browse the repository at this point in the history
Modified the init functionality to add a trailing forward slash to the
host attribute if none is provided, which is required.

This commit complements #18 ,
which caused an issue if a trailing slash was missing.
  • Loading branch information
quelsan authored and jordan-wright committed Aug 2, 2019
1 parent 9a86be5 commit 416d24b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gophish/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ class GophishClient(object):

def __init__(self, api_key, host=DEFAULT_URL, **kwargs):
self.api_key = api_key
self.host = host
if host.endswith('/'):
self.host = host
else:
self.host = host + '/'
self._client_kwargs = kwargs

def execute(self, method, path, **kwargs):
Expand Down

0 comments on commit 416d24b

Please sign in to comment.