shreemaan-abhishek commented on issue #9351:
URL: https://github.com/apache/apisix/issues/9351#issuecomment-1871800643

   I used proxy-rewrite to modify the `uri` from `/awss` to `/aws` and it 
worked:
   
   ```perl
   === TEST 1: create route with aws plugin enabled
   --- config
       location /t {
           content_by_lua_block {
               local t = require("lib.test_admin").test
   
               local code, body = t('/apisix/admin/routes/1',
                    ngx.HTTP_PUT,
                    [[{
                           "plugins": {
                               "aws-lambda": {
                                   "function_uri": 
"http://localhost:8765/httptrigger";,
                                   "authorization": {
                                       "apikey" : "testkey"
                                   }
                               },
                               "proxy-rewrite": {
                                   "uri": "/aws",
                                   "headers": {
                                       "add": {
                                           "aaa": "112233"
                                       }
                                   }
                               }
                           },
                           "uri": "/awss"
                   }]]
                   )
   
               if code >= 300 then
                   ngx.status = code
                   ngx.say("fail")
                   return
               end
   
               ngx.say(body)
           }
       }
   --- response_body
   passed
   
   
   
   === TEST 2: test plugin endpoint
   --- config
       location /t {
           content_by_lua_block {
               local t = require("lib.test_admin").test
               local core = require("apisix.core")
   
               local code, _, body, headers = t("/awss", "GET")
                if code >= 300 then
                   ngx.status = code
                   ngx.say(body)
                   return
               end
   
               -- headers proxied 2 times -- one by plugin, another by this 
test case
               core.response.set_header(headers)
               ngx.print(body)
           }
       }
   --- response_body
   aws lambda invoked
   --- response_headers
   Content-Length: 19
   ```


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