mirror of https://github.com/mpolden/echoip
parent
5d914e0dc0
commit
2b7e1de81f
|
@ -114,7 +114,7 @@ func (s *Server) newPortResponse(r *http.Request) (PortResponse, error) {
|
|||
lastElement := filepath.Base(r.URL.Path)
|
||||
port, err := strconv.ParseUint(lastElement, 10, 16)
|
||||
if err != nil || port < 1 || port > 65535 {
|
||||
return PortResponse{Port: port}, fmt.Errorf("invalid port: %d", port)
|
||||
return PortResponse{Port: port}, fmt.Errorf("invalid port: %s", lastElement)
|
||||
}
|
||||
ip, err := ipFromRequest(s.IPHeaders, r)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue