rev110, Support for 127.0.0.1:43110-less Chrome plugin, Namecoin updater ignores invalid characters in address, Every site's favicon.ico leads to main favicon to prevent 404 request when using chrome extension, Detect chrome extension proxy requests, Use wrapper=False instead of /media, 404errormessage fix
This commit is contained in:
parent
ab87f5a7f1
commit
8d5a72f0b5
9 changed files with 59 additions and 22 deletions
|
@ -23,8 +23,14 @@ class UiRequestPlugin(object):
|
|||
# Is mediarequest allowed from that referer
|
||||
def isMediaRequestAllowed(self, site_address, referer):
|
||||
referer_path = re.sub("http[s]{0,1}://.*?/", "/", referer).replace("/media", "") # Remove site address
|
||||
referer_path = re.sub("\?.*", "", referer_path) # Remove html params
|
||||
referer_site_address = re.match("/(?P<address>[A-Za-z0-9\.]+)(?P<inner_path>/.*|$)", referer_path).group("address")
|
||||
referer_path = re.sub("\?.*", "", referer_path) # Remove http params
|
||||
|
||||
if self.isProxyRequest(): # Match to site domain
|
||||
referer = re.sub("^http://zero[/]+", "http://", referer) # Allow /zero access
|
||||
print referer
|
||||
referer_site_address = re.match("http[s]{0,1}://(.*?)(/|$)", referer).group(1)
|
||||
else: # Match to request path
|
||||
referer_site_address = re.match("/(?P<address>[A-Za-z0-9\.]+)(?P<inner_path>/.*|$)", referer_path).group("address")
|
||||
|
||||
if referer_site_address == site_address: # Referer site address as simple address
|
||||
return True
|
||||
|
|
|
@ -31,6 +31,7 @@ def processNameOp(domain, value):
|
|||
names_raw = open(names_path, "rb").read()
|
||||
names = json.loads(names_raw)
|
||||
for subdomain, address in data["zeronet"].items():
|
||||
address = re.sub("[^A-Za-z0-9]", "", address)
|
||||
print subdomain, domain, "->", address
|
||||
if subdomain:
|
||||
names["%s.%s.bit" % (subdomain, domain)] = address
|
||||
|
@ -99,7 +100,8 @@ print "Processing block from #%s to #%s..." % (config["lastprocessed"], last_blo
|
|||
for block_id in range(config["lastprocessed"], last_block+1):
|
||||
processBlock(block_id)
|
||||
|
||||
# processBlock(223911) # Testing
|
||||
# processBlock(223911) # Testing zeronetwork.bit
|
||||
# processBlock(227052) # Testing brainwallets.bit
|
||||
|
||||
while 1:
|
||||
print "Waiting for new block",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue