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

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

Issue 575613003: Docserver: Gitiles auth and cron refactoring. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/servlet.py
diff --git a/chrome/common/extensions/docs/server2/servlet.py b/chrome/common/extensions/docs/server2/servlet.py
index 4b8509bd5cf0bdc91c0ce9adc5486eebb439747b..9a2e5e203d2907a9cdccf8ad8ac95d08ac4dc5c5 100644
--- a/chrome/common/extensions/docs/server2/servlet.py
+++ b/chrome/common/extensions/docs/server2/servlet.py
@@ -26,10 +26,11 @@ class RequestHeaders(object):
class Request(object):
'''Request data.
'''
- def __init__(self, path, host, headers):
+ def __init__(self, path, host, headers, arguments={}):
self.path = path.lstrip('/')
self.host = host.rstrip('/')
self.headers = RequestHeaders(headers)
+ self.arguments = arguments
@staticmethod
def ForTest(path, host=None, headers=None):
@@ -107,6 +108,12 @@ class Response(object):
'''
return Response(content=content, headers=headers, status=500)
+ @staticmethod
+ def ThrottledError(content, headers=None):
+ '''Returns an HTTP throttle error (429) response.
+ '''
+ return Response(content=content, headers=headers, status=429)
+
def Append(self, content):
'''Appends |content| to the response content.
'''
« no previous file with comments | « chrome/common/extensions/docs/server2/samples_model.py ('k') | chrome/common/extensions/docs/server2/sidenav_data_source.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698