Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
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
etersoft
bugzilla
Commits
bb16842f
Commit
bb16842f
authored
Jan 23, 2015
by
Matt Selsky
Committed by
Gervase Markham
Jan 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 662161: enhance testserver.pl to deal with missing support for HTTPS. r=gerv, a=glob.
parent
2993c6a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
testserver.pl
testserver.pl
+11
-5
No files found.
testserver.pl
View file @
bb16842f
...
@@ -26,6 +26,8 @@ my $datadir = bz_locations()->{'datadir'};
...
@@ -26,6 +26,8 @@ my $datadir = bz_locations()->{'datadir'};
eval
"require LWP; require LWP::UserAgent;"
;
eval
"require LWP; require LWP::UserAgent;"
;
my
$lwp
=
$@
?
0
:
1
;
my
$lwp
=
$@
?
0
:
1
;
eval
"require LWP::Protocol::https;"
;
my
$lwpssl
=
$@
?
0
:
1
;
if
((
@ARGV
!=
1
)
||
(
$ARGV
[
0
]
!~
/^https?:/i
))
if
((
@ARGV
!=
1
)
||
(
$ARGV
[
0
]
!~
/^https?:/i
))
{
{
...
@@ -212,12 +214,16 @@ sub fetch {
...
@@ -212,12 +214,16 @@ sub fetch {
my
$url
=
shift
;
my
$url
=
shift
;
my
$rtn
;
my
$rtn
;
if
(
$lwp
)
{
if
(
$lwp
)
{
my
$req
=
HTTP::
Request
->
new
(
GET
=>
$url
);
if
(
$url
=~
/^https:/i
&&
!
$lwpssl
)
{
my
$ua
=
LWP::
UserAgent
->
new
;
die
(
"You need LWP::Protocol::https installed to use https with testserver.pl"
);
my
$res
=
$ua
->
request
(
$req
);
}
else
{
$rtn
=
(
$res
->
is_success
?
$res
->
content
:
undef
);
my
$req
=
HTTP::
Request
->
new
(
GET
=>
$url
);
my
$ua
=
LWP::
UserAgent
->
new
;
my
$res
=
$ua
->
request
(
$req
);
$rtn
=
(
$res
->
is_success
?
$res
->
content
:
undef
);
}
}
elsif
(
$url
=~
/^https:/i
)
{
}
elsif
(
$url
=~
/^https:/i
)
{
die
(
"You need LWP installed to use https with testserver.pl"
);
die
(
"You need LWP
(and LWP::Protocol::https, for LWP 6.02 or newer)
installed to use https with testserver.pl"
);
}
else
{
}
else
{
my
(
$host
,
$port
,
$file
)
=
(
''
,
80
,
''
);
my
(
$host
,
$port
,
$file
)
=
(
''
,
80
,
''
);
if
(
$url
=~
m
#^http://([^:]+):(\d+)(/.*)#i) {
if
(
$url
=~
m
#^http://([^:]+):(\d+)(/.*)#i) {
...
...
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