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

Method actionSiteAddPrompt

src/Ui/UiRequest.py:650–660  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

648 return self.actionRedirect(post["url"])
649
650 def actionSiteAddPrompt(self, path):
651 path_parts = self.parsePath(path)
652 if not path_parts or not self.server.site_manager.isAddress(path_parts["address"]):
653 return self.error404(path)
654
655 self.sendHeader(200, "text/html", noscript=True)
656 template = open("src/Ui/template/site_add.html").read()
657 template = template.replace("{url}", html.escape(self.env["PATH_INFO"]))
658 template = template.replace("{address}", path_parts["address"])
659 template = template.replace("{add_nonce}", self.getAddNonce())
660 return template
661
662 def replaceHtmlVariables(self, block, path_parts):
663 user = self.getCurrentUser()

Callers 2

actionSiteMediaMethod · 0.95
actionSiteMediaMethod · 0.80

Calls 6

parsePathMethod · 0.95
error404Method · 0.95
sendHeaderMethod · 0.95
getAddNonceMethod · 0.95
isAddressMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected