tokers commented on code in PR #7794:
URL: https://github.com/apache/apisix/pull/7794#discussion_r955862458


##########
apisix/plugins/response-rewrite.lua:
##########
@@ -27,13 +28,63 @@ local type        = type
 local pcall       = pcall
 
 
+local lrucache = core.lrucache.new({
+    type = "plugin",
+})
+
 local schema = {
     type = "object",
     properties = {
         headers = {
             description = "new headers for response",
-            type = "object",
-            minProperties = 1,
+            anyOf = {
+                {
+                    type = "object",
+                    minProperties = 1,
+                    patternProperties = {
+                        ["^[^:]+$"] = {
+                            oneOf = {
+                                {type = "string"},
+                                {type = "number"},
+                            }
+                        }
+                    },
+                },
+                {
+                    properties = {
+                        add = {
+                            type = "array",
+                            minItems = 1,
+                            items = {
+                                type = "string",
+                                -- "Set-Cookie: <cookie-name>=<cookie-value>; 
Max-Age=<number>"
+                                pattern = "^[^:]+:[^:]+[^/]$"
+                            }
+                        },
+                        set = {

Review Comment:
   `add` and `remove` are arrays but why `set` is an object?



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