diff --git a/net.go b/net.go index a4cbe55..b293eee 100644 --- a/net.go +++ b/net.go @@ -217,7 +217,9 @@ func (e *EurekaConnection) DeregisterInstance(ins *Instance) error { log.Errorf("Could not complete deregistration, error: %s", err.Error()) return err } - if rcode != 204 { + // Eureka promises to return HTTP status code upon deregistration success, but fargo used to accept status code 204 + // here instead. Accommodate both for backward compatibility with any fake or proxy Eureka stand-ins. + if rcode != 200 && rcode != 204 { log.Warningf("HTTP returned %d deregistering Instance=%s App=%s", rcode, ins.Id(), ins.App) return fmt.Errorf("http returned %d possible failure deregistering instance\n", rcode) }