Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
http message sends over geoip info if available
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarianski committed Nov 6, 2012
1 parent 84cf340 commit 10fea66
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,16 @@ private JSONObject serializeToJson(RequestData requestData) {
json.elementOpt("remoteUser", requestData.getRemoteUser());
json.elementOpt("referer", requestData.getHttpReferer());

// TODO add remote geoip and address location once post processing is hooked up again
// country/city and lat/lon

String country = requestData.getRemoteCountry();
String city = requestData.getRemoteCity();
// country and city only get set if we have geoip information
// if we don't check, we will send lat/lon values of 0 because those are primitive
if (country != null && city != null) {
json.element("country", country);
json.element("city", city);
json.elementOpt("latitude", requestData.getRemoteLat());
json.elementOpt("longitude", requestData.getRemoteLon());
}
json.element("serverHost", requestData.getHost());
json.element("internalHost", requestData.getInternalHost());

Expand Down

0 comments on commit 10fea66

Please sign in to comment.