thirdparty/google_appengine/google/appengine/api/urlfetch.py
changeset 297 35211afcd563
parent 149 f2e327a7c5de
child 686 df109be0567c
--- a/thirdparty/google_appengine/google/appengine/api/urlfetch.py	Fri Oct 10 06:56:56 2008 +0000
+++ b/thirdparty/google_appengine/google/appengine/api/urlfetch.py	Fri Oct 10 13:14:24 2008 +0000
@@ -175,9 +175,13 @@
 
   scheme, host_port, path, query, fragment = urlparse.urlsplit(url)
 
-  if (host_port == os.environ['HTTP_HOST'] and
-      urllib2.unquote(path) == urllib2.unquote(os.environ['PATH_INFO'])):
-    return True
+  if host_port == os.environ['HTTP_HOST']:
+    current_path = urllib2.unquote(os.environ['PATH_INFO'])
+    desired_path = urllib2.unquote(path)
+
+    if (current_path == desired_path or
+        (current_path in ('', '/') and desired_path in ('', '/'))):
+      return True
 
   return False
 
@@ -264,6 +268,9 @@
     if (e.application_error ==
         urlfetch_service_pb.URLFetchServiceError.RESPONSE_TOO_LARGE):
       raise ResponseTooLargeError(None)
+    if (e.application_error ==
+        urlfetch_service_pb.URLFetchServiceError.DEADLINE_EXCEEDED):
+      raise DownloadError(str(e))
     raise e
   result = _URLFetchResult(response)