AlinsRan commented on code in PR #13597:
URL: https://github.com/apache/apisix/pull/13597#discussion_r3480217554
##########
apisix/plugins/proxy-rewrite.lua:
##########
@@ -106,6 +118,18 @@ local schema = {
oneOf = {
{ type = "string" },
{ type = "number" },
+ {
+ -- replace the header with multiple
+ -- values, e.g. ["v1", "v2"]
+ type = "array",
+ minItems = 1,
+ items = {
+ oneOf = {
+ { type = "string" },
+ { type = "number" },
+ }
+ }
+ }
Review Comment:
Supporting multiple values directly on set is exactly what avoids complexity
here.
SET still means replace here — set with an array replaces the header with
multiple values rather than a single one, which is a capability add (append,
can't drop existing) and scalar set (single value) can't express. Since the
action order is add→set→remove, a remove+add combination can't atomically
"replace with multiple values" either.
##########
apisix/plugins/proxy-rewrite.lua:
##########
@@ -106,6 +118,18 @@ local schema = {
oneOf = {
{ type = "string" },
{ type = "number" },
+ {
+ -- replace the header with multiple
+ -- values, e.g. ["v1", "v2"]
+ type = "array",
+ minItems = 1,
+ items = {
+ oneOf = {
+ { type = "string" },
+ { type = "number" },
+ }
+ }
+ }
Review Comment:
Supporting multiple values directly on set is exactly what avoids complexity
here.
The alternative — combining set and add to get "replace, but with multiple
headers" — is both more complex and semantically ambiguous: since the execution
order is add → set → remove, the values added by add would just be overwritten
by the later set, so the combination can't actually express it.
--
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]