byp4xx
byp4xx copied to clipboard
Reason for removing trailing / ?
Hi,
Is there a reason for removing the trailing "/" in this part :
#Count "/" on target param just to parse the last part of URI path
bar_count = target.count("/")
if target.endswith("/"):
bar_count = bar_count -1
if bar_count == 2:
url = target
uri = ""
else:
aux = target.split("/")
url = "/".join(aux[:bar_count])
uri = aux[bar_count]
In my use case I have a HTTP 405 when not adding the trailing "/" to the request