Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
dmlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
domotika
dmlib
Commits
faedaf04
Commit
faedaf04
authored
Feb 18, 2014
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to block location redirect
parent
bd3a5c82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
webutils.py
dmlib/utils/webutils.py
+3
-2
No files found.
dmlib/utils/webutils.py
View file @
faedaf04
...
...
@@ -145,7 +145,7 @@ class HTTPPageGetter(client.HTTPPageGetter):
def
handleStatus_301
(
self
):
l
=
self
.
headers
.
get
(
'location'
)
if
not
l
:
if
not
l
or
self
.
factory
.
nolocation
:
self
.
handleStatusDefault
()
return
url
=
l
[
0
]
...
...
@@ -315,7 +315,7 @@ class HTTPClientFactoryProgressStream(HTTPClientFactoryProgress):
def
getPage
(
url
,
progress
=
False
,
stream
=
False
,
proxy_host
=
None
,
proxy_port
=
None
,
headers
=
None
,
contextFactory
=
None
,
uniqueid
=
False
,
http_user
=
None
,
http_password
=
None
,
headerscb
=
None
,
*
args
,
**
kwargs
):
contextFactory
=
None
,
uniqueid
=
False
,
http_user
=
None
,
http_password
=
None
,
headerscb
=
None
,
nolocation
=
False
,
*
args
,
**
kwargs
):
parsed
=
urlparse
.
urlsplit
(
url
)
if
not
http_user
:
...
...
@@ -345,6 +345,7 @@ def getPage(url, progress=False, stream=False, proxy_host = None, proxy_port = N
factory
.
http_user
=
http_user
factory
.
http_password
=
http_password
factory
.
uniqueid
=
uniqueid
factory
.
nolocation
=
nolocation
if
scheme
==
'https'
:
from
twisted.internet
import
ssl
...
...
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