diff --git a/eureka-client-jersey3/src/main/java/com/netflix/discovery/shared/transport/jersey3/AbstractJersey3EurekaHttpClient.java b/eureka-client-jersey3/src/main/java/com/netflix/discovery/shared/transport/jersey3/AbstractJersey3EurekaHttpClient.java index f2be9c922..479edf17c 100644 --- a/eureka-client-jersey3/src/main/java/com/netflix/discovery/shared/transport/jersey3/AbstractJersey3EurekaHttpClient.java +++ b/eureka-client-jersey3/src/main/java/com/netflix/discovery/shared/transport/jersey3/AbstractJersey3EurekaHttpClient.java @@ -147,7 +147,7 @@ public EurekaHttpResponse sendHeartBeat(String appName, String id, requestBuilder.accept(MediaType.APPLICATION_JSON_TYPE); response = requestBuilder.put(Entity.entity("{}", MediaType.APPLICATION_JSON_TYPE)); // Jersey3 refuses to handle PUT with no body EurekaHttpResponseBuilder eurekaResponseBuilder = anEurekaHttpResponse(response.getStatus(), InstanceInfo.class).headers(headersOf(response)); - if (response.hasEntity()) { + if (response.getStatus() != Status.NOT_FOUND.getStatusCode() && response.hasEntity()) { eurekaResponseBuilder.entity(response.readEntity(InstanceInfo.class)); } return eurekaResponseBuilder.build();