Whitespace normalization.

This commit is contained in:
Tim Peters 2001-02-28 08:26:44 +00:00
parent 8de0c1716b
commit 85ba673b0a
6 changed files with 11 additions and 12 deletions

View file

@ -561,17 +561,17 @@ class FancyURLopener(URLopener):
See this URL for a description of the basic authentication scheme:
http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt"""
if not headers.has_key('www-authenticate'):
URLopener.http_error_default(self, url, fp,
URLopener.http_error_default(self, url, fp,
errmsg, headers)
stuff = headers['www-authenticate']
import re
match = re.match('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff)
if not match:
URLopener.http_error_default(self, url, fp,
URLopener.http_error_default(self, url, fp,
errcode, errmsg, headers)
scheme, realm = match.groups()
if scheme.lower() != 'basic':
URLopener.http_error_default(self, url, fp,
URLopener.http_error_default(self, url, fp,
errcode, errmsg, headers)
name = 'retry_' + self.type + '_basic_auth'
if data is None: