This is an automated email from the ASF dual-hosted git repository.

kimmking pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new a0db13ab5a [type:refactor] adjust code order and remove invalid input 
parameters (#5397)
a0db13ab5a is described below

commit a0db13ab5af5037e2e8ddbae6236a31e519abb43
Author: hdgaadd <[email protected]>
AuthorDate: Wed Jan 31 00:10:26 2024 +0800

    [type:refactor] adjust code order and remove invalid input parameters 
(#5397)
    
    Co-authored-by: hdgaadd <[email protected]>
    Co-authored-by: dragon-zhang <[email protected]>
---
 .../apache/shenyu/plugin/modify/response/ModifyResponsePlugin.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/shenyu-plugin/shenyu-plugin-modify-response/src/main/java/org/apache/shenyu/plugin/modify/response/ModifyResponsePlugin.java
 
b/shenyu-plugin/shenyu-plugin-modify-response/src/main/java/org/apache/shenyu/plugin/modify/response/ModifyResponsePlugin.java
index 92d261bdce..c4b191928e 100644
--- 
a/shenyu-plugin/shenyu-plugin-modify-response/src/main/java/org/apache/shenyu/plugin/modify/response/ModifyResponsePlugin.java
+++ 
b/shenyu-plugin/shenyu-plugin-modify-response/src/main/java/org/apache/shenyu/plugin/modify/response/ModifyResponsePlugin.java
@@ -96,8 +96,8 @@ public class ModifyResponsePlugin extends 
AbstractShenyuPlugin {
         @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);
@@ -105,7 +105,7 @@ public class ModifyResponsePlugin extends 
AbstractShenyuPlugin {
             });
         }
 
-        private void buildModifiedResponse(final Publisher<? extends 
DataBuffer> body) {
+        private void modifyResponseHeadersAndStatus() {
             HttpHeaders httpHeaders = new HttpHeaders();
             // add origin headers
             httpHeaders.addAll(this.getHeaders());

Reply via email to