Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 559210 Details for
Bug 566778
app-portage/mirrorselect-2.2.2-r2: Don't use bare IP addresses to check HTTP distfile mirrors (or at least send a Host: header)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
set host in request
fix_url_host.patch (text/plain), 1.22 KB, created by
Michel Ganguin
on 2019-01-01 00:24:49 UTC
(
hide
)
Description:
set host in request
Filename:
MIME Type:
Creator:
Michel Ganguin
Created:
2019-01-01 00:24:49 UTC
Size:
1.22 KB
patch
obsolete
>diff --git a/mirrorselect/selectors.py b/mirrorselect/selectors.py >index b3944a6..d1f8b99 100644 >--- a/mirrorselect/selectors.py >+++ b/mirrorselect/selectors.py >@@ -42,6 +42,7 @@ if sys.version_info[0] >= 3: > url_parse = urllib.parse.urlparse > url_unparse = urllib.parse.urlunparse > url_open = urllib.request.urlopen >+ url_request = urllib.request.Request > HTTPError = urllib.error.HTTPError > import http.client > IncompleteRead = http.client.IncompleteRead >@@ -51,6 +52,7 @@ else: > url_parse = urlparse.urlparse > url_unparse = urlparse.urlunparse > url_open = urllib2.urlopen >+ url_request = urllib2.Request > HTTPError = urllib2.HTTPError > import httplib > IncompleteRead = httplib.IncompleteRead >@@ -368,7 +370,9 @@ class Deep(object): > try: > signal.alarm(int(math.ceil(maxtime))) > stime = time.time() >- f = url_open(test_url) >+ r = url_request(test_url) >+ r.host = url_parts.netloc >+ f = url_open(r) > > md5 = hashlib.md5(f.read()).hexdigest() > >@@ -419,7 +423,9 @@ class Deep(object): > try: > try: > signal.alarm(self._connect_timeout) >- f = url_open(test_url) >+ r = url_request(test_url) >+ r.host = url_parts.netloc >+ f = url_open(r) > early_out = True > finally: > signal.alarm(0)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 566778
:
514746
| 559210