Skip to content

Update threadscanner.py#23

Open
roxas-tan wants to merge 1 commit intodionach:masterfrom
roxas-tan:master
Open

Update threadscanner.py#23
roxas-tan wants to merge 1 commit intodionach:masterfrom
roxas-tan:master

Conversation

@roxas-tan
Copy link

Fixed error http.client.InvalidURL: URL can't contain control characters

Fixed error http.client.InvalidURL: URL can't contain control characters
@Neonatus
Copy link

Neonatus commented Mar 3, 2021

The problem persists.

@duanearnett
Copy link

This PR fixed an issue I was having with the following error:

[-] Searching Wordpress Plugins ...
0%Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/dist-packages/cmsmap/lib/threadscanner.py", line 30, in run
    requester.request(self.url + self.pluginPath + plugin + self.pluginPathEnd, data=None)
  File "/usr/local/lib/python3.9/dist-packages/cmsmap/lib/requester.py", line 31, in request
    self.response = urllib.request.urlopen(self.req)
  File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.9/urllib/request.py", line 517, in open
    response = self._open(req, data)
  File "/usr/lib/python3.9/urllib/request.py", line 534, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 1375, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.9/urllib/request.py", line 1346, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.9/http/client.py", line 1253, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1264, in _send_request
    self.putrequest(method, url, **skips)
  File "/usr/lib/python3.9/http/client.py", line 1098, in putrequest
    self._validate_path(url)
  File "/usr/lib/python3.9/http/client.py", line 1198, in _validate_path
    raise InvalidURL(f"URL can't contain control characters. {url!r} "
http.client.InvalidURL: URL can't contain control characters. '/wp-content/plugins/worprees plugin bug dar/' (found at least ' ')

After applying @roxas-tan 's fix it works fine for me in this scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments