Adds missing method implementations

This commit is contained in:
Spencer Gibb
2019-12-18 22:59:14 -05:00
parent 9f836fb42d
commit bc8f8f0bf9
2 changed files with 24 additions and 0 deletions

View File

@@ -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 -> {

View File

@@ -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();