Skip to content

Commit

Permalink
Merge branch 'master' into feat-peak-ewma
Browse files Browse the repository at this point in the history
  • Loading branch information
impactCn authored Jan 31, 2024
2 parents db9229c + a0db13a commit 5c0bf79
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,16 @@ static class ModifyResponseDecorator extends ServerHttpResponseDecorator {
@Override
@NonNull
public Mono<Void> writeWith(@NonNull final Publisher<? extends DataBuffer> body) {
modifyResponseHeadersAndStatus();
final Mono<DataBuffer> dataBufferMono = DataBufferUtils.join(body);
buildModifiedResponse(body);
return dataBufferMono.flatMap(dataBuffer -> {
byte[] bytes = new byte[dataBuffer.readableByteCount()];
dataBuffer.read(bytes);
return WebFluxResultUtils.result(this.exchange, modifyBody(bytes));
});
}

private void buildModifiedResponse(final Publisher<? extends DataBuffer> body) {
private void modifyResponseHeadersAndStatus() {
HttpHeaders httpHeaders = new HttpHeaders();
// add origin headers
httpHeaders.addAll(this.getHeaders());
Expand Down

0 comments on commit 5c0bf79

Please sign in to comment.