Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/server_instance.py |
| diff --git a/chrome/common/extensions/docs/server2/server_instance.py b/chrome/common/extensions/docs/server2/server_instance.py |
| index ba978ceedef86cd7343052aba42e02d028dcd753..8750ce52d8bfaf977ab7dcef215f7d53d90f3606 100644 |
| --- a/chrome/common/extensions/docs/server2/server_instance.py |
| +++ b/chrome/common/extensions/docs/server2/server_instance.py |
| @@ -11,8 +11,9 @@ class ServerInstance(object): |
| """This class is used to hold a data source and fetcher for an instance of a |
| server. Each new branch will get its own ServerInstance. |
| """ |
| - def __init__(self, template_data_source, cache_builder): |
| + def __init__(self, template_data_source, zip_data_source, cache_builder): |
| self._template_data_source = template_data_source |
| + self._zip_data_source = zip_data_source |
| self._cache = cache_builder.build(lambda x: x) |
| mimetypes.init() |
| @@ -29,7 +30,11 @@ class ServerInstance(object): |
| return '' |
| def Get(self, path, request_handler): |
| - if path.startswith('static'): |
| + if path.endswith('.zip'): |
|
not at google - send to devlin
2012/07/11 00:35:09
I'd be more comfortable if this was restricted spe
cduvall
2012/07/11 20:56:30
Done. I used re because glob is only for the files
|
| + content = self._zip_data_source[path] |
| + request_handler.response.headers['content-type'] = ( |
| + mimetypes.types_map['.zip']) |
| + elif path.startswith('static'): |
| content = self._FetchStaticResource(path, request_handler) |
| else: |
| content = self._template_data_source.Render(path) |