Goxiaoy opened a new issue #74:
URL: https://github.com/apache/apisix-go-plugin-runner/issues/74


   ### Issue description
   ```
   w http.ResponseWriter, r pkgHTTP.Request
   r.RespHeader().Add("Set-Cookie","a=a; Expires=Wed, 21 Oct 2023 07:28:00 GMT; 
Secure; HttpOnly")
   r.RespHeader().Add("Set-Cookie","b=b; Expires=Wed, 21 Oct 2023 07:28:00 GMT; 
Secure; HttpOnly")
   ```
   
   Cookie `a` is missing in the response header
   
   Workaround
   
   Concat resp header before return
   ```
        w http.ResponseWriter, r pkgHTTP.Request
        r.RespHeader().Add("Set-Cookie","a=a; Expires=Wed, 21 Oct 2023 07:28:00 
GMT; Secure; HttpOnly")
        r.RespHeader().Add("Set-Cookie","b=b; Expires=Wed, 21 Oct 2023 07:28:00 
GMT; Secure; HttpOnly")
   
        if len(r.RespHeader().Values("Set-Cookie")) > 0 {
                r.RespHeader().Set("Set-Cookie", 
strings.Join(r.RespHeader().Values("Set-Cookie"), "; "))
        }
   ```
   
   ### Environment
   
   * APISIX Go Plugin Runner's version: dee7fa0167af0ed8cdcd87d4321a43b194f2a7ed
   * APISIX version: 2.13.0
   * Go version: 1.18
   * OS (cmd: `uname -a`): centos
   
   ### Minimal test code / Steps to reproduce the issue
   
   1. Start APISIX on docker 
   2. Set Plugin filter codes
   ```
   Filter(conf interface{}, w http.ResponseWriter, r pkgHTTP.Request)
   {
     r.RespHeader().Add("Set-Cookie","a=a; Expires=Wed, 21 Oct 2023 07:28:00 
GMT; Secure; HttpOnly")
     r.RespHeader().Add("Set-Cookie","b=b; Expires=Wed, 21 Oct 2023 07:28:00 
GMT; Secure; HttpOnly")
     return
   }
   
   ```
   4. Cookie `a` is missing in the response header
   
   ### What's the actual result? (including assertion message & call stack if 
applicable)
   
   Cookie `b` can be found, Cookie `a` is missing
   
   ### What's the expected result?
   Both cookie `a` and `b` could be found


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