Add Flux<Part> ServerRequest.parts()
This commit introduces Flux<Part> ServerRequest.parts() that delegates to ServerWebExchange.getParts() and offers an alternative, streaming way of accessing multipart data. Closes gh-23131
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -249,6 +249,13 @@ public final class MockServerRequest implements ServerRequest {
|
||||
return (Mono<MultiValueMap<String, Part>>) this.body;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Flux<Part> parts() {
|
||||
Assert.state(this.body != null, "No body");
|
||||
return (Flux<Part>) this.body;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerWebExchange exchange() {
|
||||
Assert.state(this.exchange != null, "No exchange");
|
||||
|
||||
Reference in New Issue
Block a user