Skip to content

Commit 3608512

Browse files
authored
Merge pull request #31 from aliaspooryorik/development
Update SentryService.cfc
2 parents 6b052b1 + ff446cf commit 3608512

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

models/SentryService.cfc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ component accessors=true singleton {
642642
var signature = "";
643643
var header = "";
644644
var timeVars = getTimeVars();
645-
var httpRequestData = getHTTPRequestData();
645+
var httpRequestData = getHTTPDataForRequest();
646646

647647
// Add global metadata
648648
arguments.captureStruct[ "event_id" ] = lCase( replace( createUUID(), "-", "", "all" ) );
@@ -882,7 +882,7 @@ component accessors=true singleton {
882882
* Get Real IP, by looking at clustered, proxy headers and locally.
883883
*/
884884
private function getRealIP(){
885-
var headers = getHTTPRequestData().headers;
885+
var headers = getHTTPDataForRequest().headers;
886886

887887
// When going through a proxy, the IP can be a delimtied list, thus we take the last one in the list
888888

@@ -995,4 +995,18 @@ component accessors=true singleton {
995995
return normalizedPath.replace( "//", "/", "all" );
996996
}
997997

998+
/**
999+
* I return the http request data
1000+
*/
1001+
struct function getHTTPDataForRequest() {
1002+
try {
1003+
var result = getHTTPRequestData();
1004+
if ( !isNull( result ) ) {
1005+
return result;
1006+
}
1007+
} catch ( any e ) {
1008+
}
1009+
return { "headers" : {}, "content" : "" };
1010+
}
1011+
9981012
}

0 commit comments

Comments
 (0)