Skip to content

Commit

Permalink
Added version to User-Agent header
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas committed Dec 13, 2011
1 parent 8d33867 commit 36c797f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/needle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////
// Needle -- Node Simple HTTP Client
// Written by Tomas Pollak <tomas@forkhq.com>
// Written by Tomás Pollak <tomas@forkhq.com>
// (c) 2011 - Fork Ltd.
// MIT Licensed
//////////////////////////////////////////
Expand All @@ -11,7 +11,8 @@ var util = require('util'),
http = require('http'),
https = require('https'),
url = require('url'),
stringify = require('qs').stringify;
stringify = require('qs').stringify,
version = require('./../package').version;

var parsers = {
'application/json': function(data, callback){
Expand Down Expand Up @@ -81,7 +82,7 @@ var Needle = {

var headers = {
"Host" : remote.hostname,
"User-Agent": "Needle/1.0 (NodeJS " + process.version + ")",
"User-Agent": "Needle/" + version + " (NodeJS " + process.version + ")",
"Connection": "close",
"Accept": "*/*"
}
Expand Down

0 comments on commit 36c797f

Please sign in to comment.