MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / processQueryString

Method processQueryString

src/Ui/UiRequest.py:404–417  ·  view source on GitHub ↗
(self, site, query_string)

Source from the content-addressed store, hash-verified

402 return server_url
403
404 def processQueryString(self, site, query_string):
405 match = re.search("zeronet_peers=(.*?)(&|$)", query_string)
406 if match:
407 query_string = query_string.replace(match.group(0), "")
408 num_added = 0
409 for peer in match.group(1).split(","):
410 if not re.match(".*?:[0-9]+$", peer):
411 continue
412 ip, port = peer.rsplit(":", 1)
413 if site.addPeer(ip, int(port), source="query_string"):
414 num_added += 1
415 site.log.debug("%s peers added by query string" % num_added)
416
417 return query_string
418
419 def renderWrapper(self, site, path, inner_path, title, extra_headers, show_loadingscreen=None, script_nonce=None):
420 file_inner_path = inner_path

Callers 1

renderWrapperMethod · 0.95

Calls 1

addPeerMethod · 0.80

Tested by

no test coverage detected