abhi0476 commented on code in PR #256:
URL: 
https://github.com/apache/apisix-java-plugin-runner/pull/256#discussion_r1289018131


##########
runner-plugin-sdk/src/main/java/org/apache/apisix/plugin/runner/PostResponse.java:
##########
@@ -116,7 +130,27 @@ public void setHeader(String headerKey, String 
headerValue) {
         if (Objects.isNull(headers)) {
             headers = new HashMap<>();
         }
-        headers.put(headerKey, headerValue);
+
+        headers.put(headerKey, new ArrayList<>());
+        headers.get(headerKey).add(headerValue);
+    }
+
+    public void addHeader(String headerKey, String headerValue) {

Review Comment:
   made it private



##########
runner-plugin-sdk/src/main/java/org/apache/apisix/plugin/runner/PostResponse.java:
##########
@@ -116,7 +130,27 @@ public void setHeader(String headerKey, String 
headerValue) {
         if (Objects.isNull(headers)) {
             headers = new HashMap<>();
         }
-        headers.put(headerKey, headerValue);
+
+        headers.put(headerKey, new ArrayList<>());
+        headers.get(headerKey).add(headerValue);
+    }
+
+    public void addHeader(String headerKey, String headerValue) {
+        if (headerKey == null) {
+            logger.warn("headerKey is null, ignore it");
+            return;
+        }
+
+        if (Objects.isNull(headers)) {
+            headers = new HashMap<>();
+        }
+
+        headers.putIfAbsent(headerKey, new ArrayList<>());
+        headers.get(headerKey).add(headerValue);
+    }
+
+    public Map<String, List<String>> headers() {

Review Comment:
   made it private



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to