Skip to content

Commit

Permalink
Send User-Agent with all requests, hopefully reducing the amount of 4…
Browse files Browse the repository at this point in the history
…03 responses from servers. Fixes #9
  • Loading branch information
Munter committed Apr 15, 2015
1 parent 118f8a1 commit c5d7ff0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var AssetGraph = require('assetgraph');
var query = AssetGraph.query;
var async = require('async');
var request = require('request');
var version = require('../package.json').version;

var TapRender = require('tap-render');

Expand Down Expand Up @@ -91,7 +92,10 @@ module.exports = function (options) {
request({
url: url.replace(/#.*$/, ''),
strictSSL: true,
gzip: true
gzip: true,
headers: {
'User-Agent': 'Hyperlink v' + version + ' (https://www.npmjs.com/package/hyperlink)'
}
}, function (error, res) {
var status,
redirects;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"homepage": "https://github.com/Munter/hyperlink",
"dependencies": {
"assetgraph": "^1.17.4",
"assetgraph": "^1.17.5",
"async": "^0.9.0",
"lodash": "^3.5.0",
"optimist": "^0.6.1",
Expand Down

0 comments on commit c5d7ff0

Please sign in to comment.