Skip to content

Commit 882c18a

Browse files
committed
Misc cleanup
1 parent 18fbd68 commit 882c18a

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/raven.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -732,30 +732,30 @@ function getHttpData() {
732732
return;
733733
}
734734

735-
var http = {
735+
var httpData = {
736736
headers: {
737737
'User-Agent': navigator.userAgent
738738
}
739739
};
740740

741-
http.url = document.location.href;
741+
httpData.url = document.location.href;
742742

743743
if (document.referrer) {
744-
http.headers.Referer = document.referrer;
744+
httpData.headers.Referer = document.referrer;
745745
}
746746

747-
return http;
747+
return httpData;
748748
}
749749

750750
function send(data) {
751751
var baseData = {
752752
project: globalProject,
753753
logger: globalOptions.logger,
754754
platform: 'javascript'
755-
};
756-
var http = getHttpData();
757-
if (http) {
758-
baseData.request = http;
755+
}, httpData = getHttpData();
756+
757+
if (httpData) {
758+
baseData.request = httpData;
759759
}
760760

761761
data = objectMerge(baseData, data);
@@ -765,9 +765,7 @@ function send(data) {
765765
data.extra = objectMerge(objectMerge({}, globalContext.extra), data.extra);
766766

767767
// Send along our own collected metadata with extra
768-
data.extra = objectMerge({
769-
'session:duration': now() - startTime
770-
}, data.extra);
768+
data.extra['session:duration'] = now() - startTime;
771769

772770
// If there are no tags/extra, strip the key from the payload alltogther.
773771
if (isEmptyObject(data.tags)) delete data.tags;

0 commit comments

Comments
 (0)