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
4b867ea3
...
4b867ea30c4df38160aa3e2f2557554085df4bf1
authored
2013-02-17 14:16:45 -0500
by
Oleg Pudeyev
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Check that user-agent header exists before retrieving it
1 parent
661c77ec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
tests/suites/casper/agent.js
tests/suites/casper/agent.js
View file @
4b867ea
...
...
@@ -7,9 +7,11 @@ function testUA(ua, match) {
}
function
fetchUA
(
request
)
{
testUA
(
request
.
headers
.
filter
(
function
(
header
)
{
var
headers
=
request
.
headers
.
filter
(
function
(
header
)
{
return
header
.
name
===
"User-Agent"
;
}).
pop
().
value
,
/plop/
);
});
casper
.
test
.
assert
(
headers
.
length
>
0
);
testUA
(
headers
.
pop
().
value
,
/plop/
);
}
casper
.
test
.
begin
(
'userAgent() tests'
,
2
,
function
(
test
)
{
...
...
Please
register
or
sign in
to post a comment