guacapy icon indicating copy to clipboard operation
guacapy copied to clipboard

Double / when omitting a URL prefix

Open Xboarder56 opened this issue 3 years ago • 1 comments

Not sure if you would be opposed to a change request but trying to use this module I ran into an issue with it adding double /'s into the request when omitting a URL prefix (default is append it's own / as well).

self.REST_API = "{}://{}{}/api".format(method, hostname, url_path)

So when making a request with the following it fails:

client = guacapy.Guacamole(hostname="guacamole.example.com", username=BLAH, password=****, method=https)

it would return: https://guacamole.example.com//api/tokens as the reuqest url. I can kinda work around this by making the url_path variable "m" and dropping the m from the hostname but it's a really hacky work around.

I tweaked this in the forked version but wanted some thoughts before submitting the pull request.

Xboarder56 avatar Mar 16 '22 19:03 Xboarder56

looks like has been fixed:

self.REST_API = "{}://{}{}api".format(method, hostname, url_path)

ptr-app avatar Jul 01 '24 13:07 ptr-app