Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
57f8ed97
...
57f8ed976960be98c76eb54171f7c6b947cee162
authored
2013-05-09 11:20:14 -0500
by
Sean Massa
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
adjusted method check to work properly with non-string values
1 parent
25ad1e79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
2 deletions
modules/casper.js
modules/casper.js
View file @
57f8ed9
...
...
@@ -1357,8 +1357,7 @@ Casper.prototype.open = function open(location, settings) {
// http method
// taken from https://github.com/ariya/phantomjs/blob/master/src/webpage.cpp#L302
var
methods
=
[
"get"
,
"head"
,
"put"
,
"post"
,
"delete"
];
var
lowerCaseMethod
=
settings
.
method
.
toLowerCase
();
if
(
settings
.
method
&&
(
!
utils
.
isString
(
settings
.
method
)
||
methods
.
indexOf
(
lowerCaseMethod
)
===
-
1
))
{
if
(
settings
.
method
&&
(
!
utils
.
isString
(
settings
.
method
)
||
methods
.
indexOf
(
settings
.
method
.
toLowerCase
())
===
-
1
))
{
throw
new
CasperError
(
"open(): settings.method must be part of "
+
methods
.
join
(
', '
));
}
// http data
...
...
Please
register
or
sign in
to post a comment