Skip to content
This repository has been archived by the owner on Jan 27, 2019. It is now read-only.

Commit

Permalink
Update ua string
Browse files Browse the repository at this point in the history
  • Loading branch information
johno committed Dec 24, 2016
1 parent ac72d2e commit d6b755a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
language: node_js
sudo: false
node_js:
- '7'
- '6'
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ var cheerio = require('cheerio');
var normalizeUrl = require('normalize-url');
var stripHtmlComments = require('strip-html-comments');
var resolveCssImportUrls = require('resolve-css-import-urls');
var ua = require('ua-string');

var getLinkContents = require('./utils/get-link-contents');
var createLink = require('./utils/create-link');
var userAgentString = require('./utils/user-agent-string');

module.exports = function(url, options){
var deferred = q.defer();
var options = options || {};
options.headers = options.headers || {};
options.headers['User-Agent'] = options.headers['User-Agent'] || userAgentString();
options.headers['User-Agent'] = options.headers['User-Agent'] || ua;
options.timeout = options.timeout || 5000;
options.gzip = true;

Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"q": "^1.4.1",
"request": "^2.79.0",
"resolve-css-import-urls": "1.0.0",
"strip-html-comments": "1.0.0"
"strip-html-comments": "1.0.0",
"ua-string": "^1.0.0"
},
"devDependencies": {
"mocha": "^3.2.0"
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions utils/user-agent-string.js

This file was deleted.

0 comments on commit d6b755a

Please sign in to comment.