diff --git a/main.go b/main.go index cfdab5d..d8ef9eb 100644 --- a/main.go +++ b/main.go @@ -138,10 +138,6 @@ func handler(resp http.ResponseWriter, req *http.Request) { var ok bool repo.Version, ok = parseVersion(m[3]) if !ok { - if repo.Version == TooHighVersion { - sendNotFound(resp, "Version %q contains a number which is out of range.", m[3]) - return - } sendNotFound(resp, "Version %q improperly considered invalid; please warn the service maintainers.", m[3]) return } diff --git a/version.go b/version.go index f23b254..35fc800 100644 --- a/version.go +++ b/version.go @@ -48,7 +48,6 @@ func (v Version) IsValid() bool { } var InvalidVersion = Version{-1, -1, -1} -var TooHighVersion = Version{-2, -2, -2} func parseVersion(s string) (Version, bool) { if len(s) < 2 { @@ -67,20 +66,17 @@ func parseVersion(s string) (Version, bool) { if len(part) == 0 || part[0] == '0' { return InvalidVersion, false } - num, err := strconv.ParseInt(part, 10, 32) + num, err := strconv.Atoi(part) if err != nil { - if err.(*strconv.NumError).Err == strconv.ErrRange { - return TooHighVersion, false - } return InvalidVersion, false } switch i { case 0: - v.Major = int(num) + v.Major = num case 1: - v.Minor = int(num) + v.Minor = num case 2: - v.Patch = int(num) + v.Patch = num } }