Index: chrome/common/extensions/docs/server/chromeextensionsdocs.py |
diff --git a/chrome/common/extensions/docs/server/chromeextensionsdocs.py b/chrome/common/extensions/docs/server/chromeextensionsdocs.py |
index e74462374a118f2a33981c18c12c02f6cad400ae..26fdfd41802b8e9f2471d7e0581b7a19768cef8a 100644 |
--- a/chrome/common/extensions/docs/server/chromeextensionsdocs.py |
+++ b/chrome/common/extensions/docs/server/chromeextensionsdocs.py |
@@ -76,6 +76,13 @@ class MainPage(webapp.RequestHandler): |
if result.status_code != 200: |
logging.error("urlfetch failed: " + url) |
# TODO(nickbaum): what should we do when the urlfetch fails? |
+ # Files inside of samples should be rendered with content-type |
+ # text/plain so that their source is visible when linked to. The only |
+ # types we should serve as-is are images. |
+ if (path[:9] == "/examples" and |
Aaron Boodman
2011/12/14 21:42:15
startswith() ?
Mike West
2011/12/14 21:49:02
Learn something new every day... Using it now.
|
+ result.headers['content-type'][:6] != 'image/' and |
+ result.headers['Content-Type'][:6] != 'image/'): |
+ result.headers['content-type'] = 'text/plain' |
except: |
logging.error("urlfetch failed: " + url) |
# TODO(nickbaum): what should we do when the urlfetch fails? |