increased admin (is_local) security, thanks Jonathan
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.1.0 (2012-10-10 11:57:26) dev
|
Version 2.1.0 (2012-10-10 12:00:56) dev
|
||||||
|
|||||||
+7
-4
@@ -425,7 +425,6 @@ def wsgibase(environ, responder):
|
|||||||
# ##################################################
|
# ##################################################
|
||||||
app = request.application ## must go after url_in!
|
app = request.application ## must go after url_in!
|
||||||
|
|
||||||
http_host = env.http_host.split(':',1)[0]
|
|
||||||
if not global_settings.local_hosts:
|
if not global_settings.local_hosts:
|
||||||
local_hosts = ['127.0.0.1','::ffff:127.0.0.1']
|
local_hosts = ['127.0.0.1','::ffff:127.0.0.1']
|
||||||
if not global_settings.web2py_runtime_gae:
|
if not global_settings.web2py_runtime_gae:
|
||||||
@@ -434,11 +433,15 @@ def wsgibase(environ, responder):
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
local_hosts.append(socket.gethostbyname(http_host))
|
if env.server_name:
|
||||||
|
local_hosts += [
|
||||||
|
env.server_name,
|
||||||
|
socket.gethostbyname(env.server_name)]
|
||||||
except (socket.gaierror,TypeError):
|
except (socket.gaierror,TypeError):
|
||||||
pass
|
pass
|
||||||
global_settings.local_hosts = local_hosts
|
global_settings.local_hosts = local_hosts
|
||||||
local_hosts = global_settings.local_hosts + [http_host]
|
else:
|
||||||
|
local_hosts = global_settings.local_hosts
|
||||||
client = get_client(env)
|
client = get_client(env)
|
||||||
x_req_with = str(env.http_x_requested_with).lower()
|
x_req_with = str(env.http_x_requested_with).lower()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user