fixed issue 964, thanks Michael and Jonathan
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.0.3 (2012-08-30 15:38:37) stable
|
Version 2.0.3 (2012-08-30 17:04:01) stable
|
||||||
|
|||||||
+9
-5
@@ -30,7 +30,7 @@ import string
|
|||||||
import urllib2
|
import urllib2
|
||||||
from thread import allocate_lock
|
from thread import allocate_lock
|
||||||
|
|
||||||
from fileutils import abspath, write_file, parse_version
|
from fileutils import abspath, write_file, parse_version, copystream
|
||||||
from settings import global_settings
|
from settings import global_settings
|
||||||
from admin import add_path_first, create_missing_folders, create_missing_app_folders
|
from admin import add_path_first, create_missing_folders, create_missing_app_folders
|
||||||
from globals import current
|
from globals import current
|
||||||
@@ -84,7 +84,6 @@ from http import HTTP, redirect
|
|||||||
from globals import Request, Response, Session
|
from globals import Request, Response, Session
|
||||||
from compileapp import build_environment, run_models_in, \
|
from compileapp import build_environment, run_models_in, \
|
||||||
run_controller_in, run_view_in
|
run_controller_in, run_view_in
|
||||||
from fileutils import copystream, parse_version
|
|
||||||
from contenttype import contenttype
|
from contenttype import contenttype
|
||||||
from dal import BaseAdapter
|
from dal import BaseAdapter
|
||||||
from settings import global_settings
|
from settings import global_settings
|
||||||
@@ -384,7 +383,7 @@ def wsgibase(environ, responder):
|
|||||||
# ##################################################
|
# ##################################################
|
||||||
|
|
||||||
eget = environ.get
|
eget = environ.get
|
||||||
if not eget('PATH_INFO',None) and eget('REQUEST_URI',None):
|
if not eget('PATH_INFO') and eget('REQUEST_URI'):
|
||||||
# for fcgi, get path_info and
|
# for fcgi, get path_info and
|
||||||
# query_string from request_uri
|
# query_string from request_uri
|
||||||
items = environ['REQUEST_URI'].split('?')
|
items = environ['REQUEST_URI'].split('?')
|
||||||
@@ -393,9 +392,14 @@ def wsgibase(environ, responder):
|
|||||||
environ['QUERY_STRING'] = items[1]
|
environ['QUERY_STRING'] = items[1]
|
||||||
else:
|
else:
|
||||||
environ['QUERY_STRING'] = ''
|
environ['QUERY_STRING'] = ''
|
||||||
if not eget('HTTP_HOST',None):
|
elif not eget('REQUEST_URI'):
|
||||||
|
if eget('QUERY_STRING'):
|
||||||
|
environ['REQUEST_URI'] = eget('PATH_INFO') + '?' + eget('QUERY_STRING')
|
||||||
|
else:
|
||||||
|
environ['REQUEST_URI'] = eget('PATH_INFO')
|
||||||
|
if not eget('HTTP_HOST'):
|
||||||
environ['HTTP_HOST'] = \
|
environ['HTTP_HOST'] = \
|
||||||
eget('SERVER_NAME')+':'+eget('SERVER_PORT')
|
eget('SERVER_NAME') + ':' + eget('SERVER_PORT')
|
||||||
|
|
||||||
|
|
||||||
(static_file, environ) = url_in(request, environ)
|
(static_file, environ) = url_in(request, environ)
|
||||||
|
|||||||
+3
-7
@@ -994,6 +994,7 @@ class MapUrlIn(object):
|
|||||||
static_file = pjoin(self.request.env.applications_parent,
|
static_file = pjoin(self.request.env.applications_parent,
|
||||||
'applications', self.application,
|
'applications', self.application,
|
||||||
'static', file)
|
'static', file)
|
||||||
|
self.extension = None
|
||||||
log_rewrite("route: static=%s" % static_file)
|
log_rewrite("route: static=%s" % static_file)
|
||||||
return static_file
|
return static_file
|
||||||
|
|
||||||
@@ -1053,7 +1054,7 @@ class MapUrlIn(object):
|
|||||||
if self.map_hyphen:
|
if self.map_hyphen:
|
||||||
uri = uri.replace('_', '-')
|
uri = uri.replace('_', '-')
|
||||||
app = app.replace('_', '-')
|
app = app.replace('_', '-')
|
||||||
if self.extension != 'html':
|
if self.extension and self.extension != 'html':
|
||||||
uri += '.' + self.extension
|
uri += '.' + self.extension
|
||||||
if self.language:
|
if self.language:
|
||||||
uri = '/%s%s' % (self.language, uri)
|
uri = '/%s%s' % (self.language, uri)
|
||||||
@@ -1271,19 +1272,14 @@ def map_url_in(request, env, app=False):
|
|||||||
# handle mapping of lang/static to static/lang in externally-rewritten URLs
|
# handle mapping of lang/static to static/lang in externally-rewritten URLs
|
||||||
# in case we have to handle them ourselves
|
# in case we have to handle them ourselves
|
||||||
if map.languages and map.map_static is False and map.arg0 == 'static' and map.args(1) in map.languages:
|
if map.languages and map.map_static is False and map.arg0 == 'static' and map.args(1) in map.languages:
|
||||||
if 'es' in map.languages:
|
|
||||||
print 'handle static/lang %s' % map.args(1)
|
|
||||||
map.map_controller()
|
map.map_controller()
|
||||||
map.map_language()
|
map.map_language()
|
||||||
else:
|
else:
|
||||||
if 'es' in map.languages:
|
|
||||||
print 'NO handle static/lang %s' % map.args(1)
|
|
||||||
map.map_language()
|
map.map_language()
|
||||||
map.map_controller()
|
map.map_controller()
|
||||||
static_file = map.map_static()
|
static_file = map.map_static()
|
||||||
if 'es' in map.languages:
|
|
||||||
print 'static_file=%s' % static_file
|
|
||||||
if static_file:
|
if static_file:
|
||||||
|
map.update_request()
|
||||||
return (static_file, map.env)
|
return (static_file, map.env)
|
||||||
map.map_function()
|
map.map_function()
|
||||||
map.validate_args()
|
map.validate_args()
|
||||||
|
|||||||
Reference in New Issue
Block a user