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

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

Issue 98183003: Docserver: Fix GitHub authentication issues that have recently cropped up: use (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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
« no previous file with comments | « chrome/common/extensions/docs/server2/app.yaml ('k') | chrome/common/extensions/docs/server2/cron.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/appengine_url_fetcher.py
diff --git a/chrome/common/extensions/docs/server2/appengine_url_fetcher.py b/chrome/common/extensions/docs/server2/appengine_url_fetcher.py
index 37997eb09a2e237b7134e8b3f16498d9615027c4..398d46ef8c9667acb9c02832e0a1596bcb9f57b9 100644
--- a/chrome/common/extensions/docs/server2/appengine_url_fetcher.py
+++ b/chrome/common/extensions/docs/server2/appengine_url_fetcher.py
@@ -5,7 +5,7 @@
import base64
import posixpath
-from appengine_wrappers import urlfetch
+from appengine_wrappers import GetAppVersion, urlfetch
from future import Future
@@ -18,9 +18,12 @@ class _AsyncFetchDelegate(object):
def _MakeHeaders(username, password):
- headers = { 'Cache-Control': 'max-age=0' }
+ headers = {
+ 'User-Agent': 'Chromium docserver %s' % GetAppVersion(),
+ 'Cache-Control': 'max-age=0',
+ }
if username is not None and password is not None:
- headers['Authorization'] = 'Basic %s' % base64.encodestring(
+ headers['Authorization'] = 'Basic %s' % base64.b64encode(
'%s:%s' % (username, password))
return headers
« no previous file with comments | « chrome/common/extensions/docs/server2/app.yaml ('k') | chrome/common/extensions/docs/server2/cron.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698