Changeset - b48b1ab1e52f
[Not reviewed]
0 1 0
Bradley Kuhn (bkuhn) - 8 years ago 2015-12-07 20:24:58
bkuhn@ebb.org
Avoid query string passed along in rendering.

This middleware is a bit of a mess anyway, since it's basically using
static files as templates. However, we definitely don't want to add any
GET query parameters rendered into the path name.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/views.py
Show inline comments
...
 
@@ -31,13 +31,13 @@ def fundgoal_lookup(fundraiser_sought):
 
    except FundraisingGoal.DoesNotExist:
 
     # we have no object!  do something
 
        return None
 

	
 
def index(request, *args, **kwargs):
 
    # return HttpResponse("Hello, static world: " + request.get_full_path())
 
    path = request.get_full_path()
 
    path = request.path
 
    path = path.lstrip('/')
 
    if path[-1:] == '/':
 
        path += 'index.html'
 
    STATIC_ROOT = '/home/www/website/www/conservancy/static/'
 
    fullpath = STATIC_ROOT + path
 
    if not os.path.exists(fullpath):
0 comments (0 inline, 0 general)