AlinsRan commented on PR #13597:
URL: https://github.com/apache/apisix/pull/13597#issuecomment-4810358973

   > I think both "multiple values for same header" and "same header with 
multiple values - (comma separated or not)" are the same.
   
   
   I don't think they're fully interchangeable. A headers.set object can't 
express same-name multi-value headers at all (a JSON object can't hold two 
values for one key), and emitting repeated lines is a first-class, intentional 
behavior — both HTTP and the underlying OpenResty support it 
(ngx.req.set_header(name, {...})). The array closes that gap.
   
   Real headers that rely on multiple same-name fields rather than a comma list:
   - Set-Cookie — non-combinable by spec.
   - Cookie over HTTP/2 — carried as multiple field lines, recombined with "; " 
not ",".
   - gRPC metadata — a multimap; in practice grpc-go/grpc-java neither fold 
duplicates nor split on commas, so ["a","b"] reaches the app as two entries and 
"a,b" as one. (The gRPC spec allows folding as "semantically equivalent," but 
mainstream runtimes don't, so the two forms are observably different.)


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