Skip to content

Commit

Permalink
anonymize hostnames sent to rollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
James Dumay committed Jun 24, 2016
1 parent 44edc46 commit 5a03033
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,20 @@

<j:if test="${it.includeRollbar()}">
<script>
function normalizeURL(location) {
var normalizedUrl = 'http://anon.blueocean.io' + location;
var headElements = document.getElementsByTagName('head');
if (headElements.length == 1) {
var rootUrl = headElements[0].getAttribute('data-rooturl');
if (location.startsWith(rootUrl)) {
normalizedUrl = 'http://anon.blueocean.io' + location.substring(rootUrl.length -1, location.length);
}
}
return normalizedUrl;
}
var transformer = function(payload) {
payload.data.request.user_ip = '0.0.0.0';
payload.data.request.url = normalizeURL(window.location.pathname);
};
var _rollbarConfig = {
accessToken: "81f3134dedf44871b9cc0a347b1313df",
Expand Down

0 comments on commit 5a03033

Please sign in to comment.