Commit 4b867ea3 4b867ea30c4df38160aa3e2f2557554085df4bf1 by Oleg Pudeyev

Check that user-agent header exists before retrieving it

1 parent 661c77ec
......@@ -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) {
......