Skip to content

Commit 1fc2cae

Browse files
authored
Merge pull request #48 from seh/correct-deregistration-status-code
Correct expected status code for deregistration
2 parents 9e19e95 + 16c4de7 commit 1fc2cae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ func (e *EurekaConnection) DeregisterInstance(ins *Instance) error {
217217
log.Errorf("Could not complete deregistration, error: %s", err.Error())
218218
return err
219219
}
220-
if rcode != 204 {
220+
// Eureka promises to return HTTP status code upon deregistration success, but fargo used to accept status code 204
221+
// here instead. Accommodate both for backward compatibility with any fake or proxy Eureka stand-ins.
222+
if rcode != 200 && rcode != 204 {
221223
log.Warningf("HTTP returned %d deregistering Instance=%s App=%s", rcode, ins.Id(), ins.App)
222224
return fmt.Errorf("http returned %d possible failure deregistering instance\n", rcode)
223225
}

0 commit comments

Comments
 (0)