Skip to content

Commit

Permalink
Merge pull request #28 from PhanLe1010/v0.0.x
Browse files Browse the repository at this point in the history
Temporary disable collecting the city and country code
  • Loading branch information
PhanLe1010 committed Mar 31, 2022
2 parents 3bf4272 + 543ef83 commit 4848100
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions upgraderesponder/service.go
Expand Up @@ -279,22 +279,23 @@ func canonializeField(name string) string {

// Don't need to return error to the requester
func (s *Server) recordRequest(httpReq *http.Request, req *CheckUpgradeRequest) {
xForwaredFor := httpReq.Header[HTTPHeaderXForwardedFor]
//xForwaredFor := httpReq.Header[HTTPHeaderXForwardedFor]
requestID := httpReq.Header[HTTPHeaderRequestID]
publicIP := ""
l := len(xForwaredFor)
if l != 0 {
// rightmost IP must be the public IP
publicIP = xForwaredFor[l-1]
}
//publicIP := ""
//l := len(xForwaredFor)
//if l != 0 {
// // rightmost IP must be the public IP
// publicIP = xForwaredFor[l-1]
//}

// We use IP to find the location but we don't store IP
loc, err := s.getLocation(publicIP)
if err != nil {
logrus.Errorf("Failed to get location for one ip")
}
logrus.Debugf("HTTP request: RequestID \"%v\", Location %+v, req %v",
requestID, loc, req)
//loc, err := s.getLocation(publicIP)
//if err != nil {
// logrus.Errorf("Failed to get location for one ip")
//}
//logrus.Debugf("HTTP request: RequestID \"%v\", Location %+v, req %v",
// requestID, loc, req)
var loc *Location = nil

if s.influxClient != nil {
var (
Expand Down

0 comments on commit 4848100

Please sign in to comment.