Populate host value from GetSourceIP directly (#7417)

This commit is contained in:
Harshavardhana
2019-03-25 11:45:42 -07:00
committed by GitHub
parent 0a44e70177
commit e0a87e96de
5 changed files with 13 additions and 96 deletions

View File

@@ -18,7 +18,6 @@ package cmd
import (
"context"
"net"
"net/http"
"strings"
"time"
@@ -253,9 +252,6 @@ func deleteObject(ctx context.Context, obj ObjectLayer, cache CacheObjectLayer,
return err
}
// Get host and port from Request.RemoteAddr.
host, port, _ := net.SplitHostPort(handlers.GetSourceIP(r))
// Notify object deleted event.
sendEvent(eventArgs{
EventName: event.ObjectRemovedDelete,
@@ -265,8 +261,7 @@ func deleteObject(ctx context.Context, obj ObjectLayer, cache CacheObjectLayer,
},
ReqParams: extractReqParams(r),
UserAgent: r.UserAgent(),
Host: host,
Port: port,
Host: handlers.GetSourceIP(r),
})
return nil