Bug exists in header.tmpl when request-origin is not defined in session data. I didn't see any other references to it in any other views, so I tried removing the line, which resolved the issue. Not knowing the codebase well enough, I don't know if that's a valid fix or if I'm just moving the bug out of the way.
Page I'm referring to is /public_download?shareId=blah
Error log:
[04/Nov/2015:15:32:32] HTTP Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 656, in respond
response.body = self.handler()
File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 188, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 34, in __call__
return self.callable(*self.args, **self.kwargs)
File "/opt/filelocker/controller/RootController.py", line 469, in public_download
headerHTML = str(Template(file=get_template_file('header.tmpl'), searchList=[locals(),globals()]))
File "/usr/lib64/python2.7/site-packages/Cheetah/Template.py", line 1005, in __str__
rc = getattr(self, mainMethName)()
File "_opt_filelocker_view_header_tmpl.py", line 115, in respond
File "/usr/lib/python2.7/site-packages/cherrypy/__init__.py", line 230, in __getitem__
return child[key]
File "/usr/lib/python2.7/site-packages/cherrypy/lib/sessions.py", line 263, in __getitem__
return self._data[key]
KeyError: 'request-origin'
Workaround appears to work, I removed this line from header.tmpl (line 17) and haven't found any issues yet:
var REQUEST_ORIGIN = "$cherrypy.session['request-origin']";
Disregard, I just compared the latest release with what's in the repo and noticed the change. In the copy I had, REQUEST_ORIGIN was being defined outside the if block, hence the error when $user wasn't logged in.
So this bug has already been fixed. Sorry for the noise.
No worries, thanks for taking the time to report it anyway. I'm going to close this.