Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
141e9894
Commit
141e9894
authored
Apr 23, 2000
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug reported by JP Calderone: https:// URL's didn't work.
The fix also adds support for POSTing to an https URL
parent
66bf4462
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
Lib/urllib.py
Lib/urllib.py
+8
-2
No files found.
Lib/urllib.py
View file @
141e9894
...
...
@@ -299,7 +299,7 @@ class URLopener:
raise
IOError
,
(
'http error'
,
errcode
,
errmsg
,
headers
)
if
hasattr
(
socket
,
"ssl"
):
def
open_https
(
self
,
url
):
def
open_https
(
self
,
url
,
data
=
None
):
"""Use HTTPS protocol."""
import
httplib
if
type
(
url
)
is
type
(
""
):
...
...
@@ -323,7 +323,13 @@ class URLopener:
h
=
httplib
.
HTTPS
(
host
,
0
,
key_file
=
self
.
key_file
,
cert_file
=
self
.
cert_file
)
h
.
putrequest
(
'GET'
,
selector
)
if
data
is
not
None
:
h
.
putrequest
(
'POST'
,
selector
)
h
.
putheader
(
'Content-type'
,
'application/x-www-form-urlencoded'
)
h
.
putheader
(
'Content-length'
,
'%d'
%
len
(
data
))
else
:
h
.
putrequest
(
'GET'
,
selector
)
if
auth
:
h
.
putheader
(
'Authorization: Basic %s'
%
auth
)
for
args
in
self
.
addheaders
:
apply
(
h
.
putheader
,
args
)
h
.
endheaders
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment