Mercurial > piecrust2
comparison piecrust/serving/server.py @ 913:e053a27e5aae
server: Fix crash when serving temp files like CSS maps.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 11 May 2017 13:21:18 -0700 |
parents | ab5c6a8ae90a |
children | b447c24bc8d4 |
comparison
equal
deleted
inserted
replaced
912:cd236a6af9f6 | 913:e053a27e5aae |
---|---|
145 offset = len(self.root_url) | 145 offset = len(self.root_url) |
146 rel_req_path = request.path[offset:].replace('/', os.sep) | 146 rel_req_path = request.path[offset:].replace('/', os.sep) |
147 if request.path.startswith('/_cache/'): | 147 if request.path.startswith('/_cache/'): |
148 # Some stuff needs to be served directly from the cache directory, | 148 # Some stuff needs to be served directly from the cache directory, |
149 # like LESS CSS map files. | 149 # like LESS CSS map files. |
150 full_path = os.path.join(self.root_dir, rel_req_path) | 150 full_path = os.path.join(self.appfactory.root_dir, rel_req_path) |
151 else: | 151 else: |
152 full_path = os.path.join(self._out_dir, rel_req_path) | 152 full_path = os.path.join(self._out_dir, rel_req_path) |
153 | 153 |
154 try: | 154 try: |
155 response = make_wrapped_file_response(environ, request, full_path) | 155 response = make_wrapped_file_response(environ, request, full_path) |