Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6644)

Unified Diff: chrome/common/extensions/docs/server2/server_instance.py

Issue 10826173: Extensions Docs Server: Proper path handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 53bf38cc9debbb70b1178babdfe76edfcb7f7bcd..2fa2a953c5b4bbce80b7d23d5c2c48eecfec9001 100644
--- a/chrome/common/extensions/docs/server2/server_instance.py
+++ b/chrome/common/extensions/docs/server2/server_instance.py
@@ -36,11 +36,13 @@ class ServerInstance(object):
def Get(self, path, request, response):
templates = self._template_data_source_factory.Create(request)
- if fnmatch(path, 'examples/*.zip'):
- content = self._example_zipper.Create(path[:-len('.zip')])
+ if fnmatch(path, 'extensions/examples/*.zip'):
+ content = self._example_zipper.Create(
+ path[len('extensions/'):-len('.zip')])
response.headers['content-type'] = mimetypes.types_map['.zip']
- elif path.startswith('examples/'):
- content = self._cache.GetFromFile(DOCS_PATH + '/' + path)
+ elif path.startswith('extensions/examples/'):
+ content = self._cache.GetFromFile(
+ DOCS_PATH + '/' + path[len('extensions/'):])
not at google - send to devlin 2012/08/06 23:13:46 I presume the apps samples page will be set up to
cduvall 2012/08/06 23:14:55 Right now they're just linked to the github page.
response.headers['content-type'] = 'text/plain'
elif path.startswith('static/'):
content = self._FetchStaticResource(path, response)

Powered by Google App Engine
This is Rietveld 408576698