mscb402 commented on issue #8399:
URL: https://github.com/apache/apisix/issues/8399#issuecomment-1326988072

   Then try it from curl
   
   will return cors header
   ```
   ➜  curl  http://127.0.0.1:9080/status/200 -H 'host: cb.com' -H 'Origin: 
test.com' -v 
   *   Trying 127.0.0.1:9080...
   * Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
   > GET /status/200 HTTP/1.1
   > Host: cb.com
   > User-Agent: curl/7.84.0
   > Accept: */*
   > Origin: test.com
   > 
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 200 OK
   < Content-Type: text/html; charset=utf-8
   < Content-Length: 0
   < Connection: keep-alive
   < Date: Fri, 25 Nov 2022 03:28:37 GMT
   < Access-Control-Allow-Origin: test.com
   < Access-Control-Allow-Credentials: true
   < Server: APISIX/3.0.0
   < Vary: Origin
   < Access-Control-Allow-Methods: *
   < Access-Control-Max-Age: 5
   < Access-Control-Expose-Headers: *
   < Access-Control-Allow-Headers: *
   < 
   * Connection #0 to host 127.0.0.1 left intact
   ```
   
   
   no cors header return
   ```
   ➜   curl  http://127.0.0.1:9080/status/200 -H 'host: cb.com'  -v             
           
   *   Trying 127.0.0.1:9080...
   * Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
   > GET /status/200 HTTP/1.1
   > Host: cb.com
   > User-Agent: curl/7.84.0
   > Accept: */*
   > 
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 200 OK
   < Content-Type: text/html; charset=utf-8
   < Content-Length: 0
   < Connection: keep-alive
   < Date: Fri, 25 Nov 2022 03:29:17 GMT
   < Access-Control-Allow-Origin: *
   < Access-Control-Allow-Credentials: true
   < Server: APISIX/3.0.0
   < 
   * Connection #0 to host 127.0.0.1 left intact
   ```


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