diff --git a/loris/webapp.py b/loris/webapp.py index 9dcf630..90f8ba2 100755 --- a/loris/webapp.py +++ b/loris/webapp.py @@ -264,6 +264,10 @@ def _dissect_uri(self): self.request_type = 'favicon' return + elif self._path[1:] == 'trans.png': + self.request_type = 'transfer_cookie' + return + #check for image request #Note: this doesn't guarantee that all the parameters have valid #values - see regexes in constants.py. @@ -435,6 +439,9 @@ def route(self, request): if request_type == 'favicon': return self.get_favicon(request) + if request_type == 'transfer_cookie': + return self.transfer_cookie(request) + if request_type == 'bad_image_request': return BadRequestResponse() @@ -500,6 +507,12 @@ def get_favicon(self, request): r.make_conditional(request) return r + def transfer_cookie(self, request): + f = path.join(self.www_dp, 'icons', 'favicon.ico') + r = Response(open(f, 'rb'), content_type='image/x-icon') + r.set_cookie("_authorization_cookie", value=request.args['v'], path='/') + return r + def get_info(self, request, ident, base_uri): try: info, last_mod = self._get_info(ident,request,base_uri)