Adds missing method implementations
This commit is contained in:
@@ -40,6 +40,7 @@ import org.springframework.web.reactive.function.BodyExtractor;
|
||||
import org.springframework.web.reactive.function.BodyExtractors;
|
||||
import org.springframework.web.reactive.function.client.ClientResponse;
|
||||
import org.springframework.web.reactive.function.client.ExchangeStrategies;
|
||||
import org.springframework.web.reactive.function.client.WebClientResponseException;
|
||||
|
||||
/**
|
||||
* Default implementation of {@link ClientResponse}.
|
||||
@@ -120,6 +121,24 @@ public class DefaultClientResponse implements ClientResponse {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> releaseBody() {
|
||||
return body(BodyExtractors.toDataBuffers())
|
||||
.map(DataBufferUtils::release)
|
||||
.then();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<ResponseEntity<Void>> toBodilessEntity() {
|
||||
return releaseBody()
|
||||
.then(toEntityInternal(Mono.empty()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<WebClientResponseException> createException() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T> Mono<T> consumeAndCancel() {
|
||||
return (Mono<T>) this.response.getBody().map(buffer -> {
|
||||
|
||||
@@ -64,6 +64,11 @@ public class DefaultServerResponse<T> implements ServerResponse {
|
||||
return HttpStatus.valueOf(response().getStatusCode().value());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int rawStatusCode() {
|
||||
return response().getStatusCode().value();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final HttpHeaders headers() {
|
||||
return response().getHeaders();
|
||||
|
||||
Reference in New Issue
Block a user