Skip to content

Commit

Permalink
FIx issue due to trailing / in target URL
Browse files Browse the repository at this point in the history
* Both versions example.com and axample.com/ are serving

* Both versions example.com and example.com/ are serving

* Both versions example.com and example.com/ are serving

* optimized code

* optimized code

* changes done

* changes done

* Fix #183
  • Loading branch information
amanjiofficial authored and rnehra01 committed Mar 14, 2019
1 parent 16528b3 commit 6b8b692
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions snare/cloner.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def __init__(self, root, max_depth, css_validate):

@staticmethod
def add_scheme(url):
if url[-1] == '/':
url = url.strip('/')
if yarl.URL(url).scheme:
new_url = yarl.URL(url)
err_url = yarl.URL(url + '/status_404')
Expand Down

0 comments on commit 6b8b692

Please sign in to comment.