Rev493, Fix trayicon autostart detect, Dont leak details on ui_restrict

This commit is contained in:
HelloZeroNet 2015-10-25 23:08:25 +01:00
parent 0241001205
commit 713baeab63
4 changed files with 11 additions and 13 deletions

View file

@ -117,7 +117,7 @@ class ActionsPlugin(object):
cmd = " ".join(args)
# Dont open browser on autorun
cmd = cmd.replace("start.py", "zeronet.py").replace('"--open_browser"', "").replace('"default_browser"', "")
cmd = cmd.replace("start.py", "zeronet.py").replace('"--open_browser"', "").replace('"default_browser"', "").strip()
return "@echo off\ncd /D %s \n%s" % (os.getcwd(), cmd)

View file

@ -8,7 +8,7 @@ class Config(object):
def __init__(self, argv):
self.version = "0.3.2"
self.rev = 480
self.rev = 493
self.argv = argv
self.action = None
self.createParser()

View file

@ -4,8 +4,6 @@ import os
import mimetypes
import json
import cgi
import string
import random
from Config import config
from Site import SiteManager
@ -44,7 +42,7 @@ class UiRequest(object):
# Call the request handler function base on path
def route(self, path):
if config.ui_restrict and self.env['REMOTE_ADDR'] not in config.ui_restrict: # Restict Ui access by ip
return self.error403()
return self.error403(details=False)
path = re.sub("^http://zero[/]+", "/", path) # Remove begining http://zero/ for chrome extension
path = re.sub("^http://", "/", path) # Remove begining http for chrome extension .bit access
@ -454,9 +452,9 @@ class UiRequest(object):
return self.formatError("Bad Request", message)
# You are not allowed to access this
def error403(self, message=""):
def error403(self, message="", details=True):
self.sendHeader(403)
return self.formatError("Forbidden", message)
return self.formatError("Forbidden", message, details=details)
# Send file not found error
def error404(self, path=""):