go fmt
This commit is contained in:
parent
331192ccbe
commit
2f4cc04db2
7 changed files with 30 additions and 29 deletions
|
|
@ -27,7 +27,6 @@ type loginUpload struct {
|
|||
Password string
|
||||
}
|
||||
|
||||
|
||||
func (l loginChecker) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
if addr := r.Header.Get("X-Forwarded-For"); addr != "" {
|
||||
r.RemoteAddr = addr
|
||||
|
|
@ -86,7 +85,7 @@ func (l loginChecker) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
var ip net.IP
|
||||
spl := strings.SplitN(r.RemoteAddr, ":", 2)
|
||||
if ip = net.ParseIP(spl[0]); ip == nil {
|
||||
http.Error(w, "Unable to parse given IPv4: " + spl[0], http.StatusInternalServerError)
|
||||
http.Error(w, "Unable to parse given IPv4: "+spl[0], http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
var mac *ARPEntry
|
||||
|
|
@ -120,9 +119,9 @@ func (l loginChecker) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
type myIP struct {
|
||||
Id int64 `json:"id"`
|
||||
Login string `json:"login"`
|
||||
IP string `json:"ip"`
|
||||
Id int64 `json:"id"`
|
||||
Login string `json:"login"`
|
||||
IP string `json:"ip"`
|
||||
}
|
||||
|
||||
func (l loginChecker) registerUser(username, remoteAddr string, ent ARPEntry) (net.IP, error) {
|
||||
|
|
|
|||
Reference in a new issue