Skip to content

Commit

Permalink
Merge pull request #28 from MindscapeHQ/may-issues
Browse files Browse the repository at this point in the history
May issues
  • Loading branch information
fundead committed May 8, 2015
2 parents e16ec67 + 2f68566 commit 966a497
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: node_js
node_js:
- "0.12"
- "0.11"
- "0.10"
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Raygun4Node

[![Build Status](https://travis-ci.org/MindscapeHQ/raygun4node.svg?branch=master)](https://travis-ci.org/MindscapeHQ/raygun4node)

Raygun.io plugin for Node

## Getting Started
Expand Down Expand Up @@ -103,6 +105,7 @@ View a screencast on creating an app with Node.js and Express.js, then hooking u
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using "npm test".

## Release History
- 0.6.2 - Fix utf8 chars causing 400s, log when errors occur when posting
- 0.6.1 - Replace deprecated request.host with request.hostname if it exists.
- 0.6.0 - Added ability to send tags with exception reports.
- 0.5.0 - Added filters for sensitive request data, and better affected user tracking
Expand Down
42 changes: 23 additions & 19 deletions lib/raygun.transport.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,30 @@
var http = require('https');

var send = function (options) {
var data = JSON.stringify(options.message);
var httpOptions = {
host: 'api.raygun.io',
port: 443,
path: '/entries',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': data.length,
'X-ApiKey': options.apiKey
}
};
var request = http.request(httpOptions, function (response) {
if (options.callback) {
options.callback(response);
}
});
try {
var data = new Buffer(JSON.stringify(options.message), 'utf8');
var httpOptions = {
host: 'api.raygun.io',
port: 443,
path: '/entries',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': data.length,
'X-ApiKey': options.apiKey
}
};
var request = http.request(httpOptions, function (response) {
if (options.callback) {
options.callback(response);
}
});

request.write(data);
request.end();
request.write(data);
request.end();
} catch (e) {
console.log("Raygun: error " + e + " occurred while attempting to send error with message: " + options.message);
}
};

exports.send = send;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "raygun",
"description": "Raygun.io plugin for Node",
"version": "0.6.1",
"version": "0.6.2",
"homepage": "https://github.com/MindscapeHQ/raygun4node",
"author": {
"name": "MindscapeHQ",
Expand Down

0 comments on commit 966a497

Please sign in to comment.