dbit-xia commented on issue #10945:
URL: https://github.com/apache/apisix/issues/10945#issuecomment-1976860755

   Thanks, please see my test,  @hanqingwu 
   ```
   ###
   PUT http://127.0.0.1:9180/apisix/admin/consumers
   X-API-KEY: edd1c9f034335f136f87ad84b625c8f1
   Content-Type: application/json
   
   {
     "username": "jack",
     "plugins": {
       "key-auth": {
         "key": "auth-one"
       }
     }
   }
   
   ###
   PUT http://127.0.0.1:9180/apisix/admin/global_rules/1
   X-API-KEY: edd1c9f034335f136f87ad84b625c8f1
   Content-Type: application/json
   
   
   {
     "plugins": {
       "key-auth": {
       }
     }
   }
   
   ###
   PUT http://127.0.0.1:9180/apisix/admin/routes/1
   X-API-KEY: edd1c9f034335f136f87ad84b625c8f1
   Content-Type: application/json
   
   
   {
     "uri": "/ip",
     "name": "abcd",
     "plugins": {
       "proxy-rewrite": {
         "headers": {
           "add": {
             "x-test": "123"
           }
         }
       },
       "serverless-post-function": {
         "functions": [
           "return function(conf, ctx) \n ngx.log(ngx.ERR,'router') \n 
ngx.say(ngx.req.get_headers()['x-test']); \n end"
         ]
       }
     },
     "upstream": {
       "nodes": [
         {
           "host": "httpbin.org",
           "port": 80,
           "weight": 1
         }
       ],
       "type": "roundrobin"
     },
     "status": 1
   }
   
   ###
   GET http://127.0.0.1:9080/api3/ip
   apikey: auth-one
   
   return repeat:
   123123
   ```


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