byp4xx icon indicating copy to clipboard operation
byp4xx copied to clipboard

Reason for removing trailing / ?

Open thibon opened this issue 2 years ago • 0 comments

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

thibon avatar Mar 15 '22 17:03 thibon