You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sp...@apache.org on 2022/02/25 09:20:42 UTC
[apisix] branch master updated: fix(deps): use fixed version of `net-url` (#6446)
This is an automated email from the ASF dual-hosted git repository.
spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 7f96235 fix(deps): use fixed version of `net-url` (#6446)
7f96235 is described below
commit 7f9623554e8f0172340fcc933da2cbb2cd8e8234
Author: leslie <59...@users.noreply.github.com>
AuthorDate: Fri Feb 25 17:20:35 2022 +0800
fix(deps): use fixed version of `net-url` (#6446)
---
rockspec/apisix-master-0.rockspec | 1 +
t/plugin/serverless.t | 51 +++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+)
diff --git a/rockspec/apisix-master-0.rockspec b/rockspec/apisix-master-0.rockspec
index 0ba4950..130fb0f 100644
--- a/rockspec/apisix-master-0.rockspec
+++ b/rockspec/apisix-master-0.rockspec
@@ -74,6 +74,7 @@ dependencies = {
"lualdap = 1.2.6-1",
"lua-resty-rocketmq = 0.3.0-0",
"opentelemetry-lua = 0.1-2",
+ "net-url = 0.9-1",
"xml2lua = 1.5-2",
}
diff --git a/t/plugin/serverless.t b/t/plugin/serverless.t
index 2d78390..f30b44e 100644
--- a/t/plugin/serverless.t
+++ b/t/plugin/serverless.t
@@ -679,3 +679,54 @@ GET /hello
--- error_log
default phase: access
match uri /hello
+
+
+
+=== TEST 23: add args parse test for serverless
+--- 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": {
+ "serverless-post-function": {
+ "functions" : ["return function(conf, ctx) local net_url = require(\"net.url\");
+ local args = ngx.var.args;
+ ngx.print(net_url.parse(args).path);
+ end"]
+ }
+ },
+ "upstream": {
+ "nodes": {
+ "127.0.0.1:1980": 1
+ },
+ "type": "roundrobin"
+ },
+ "uri": "/echo"
+ }]]
+ )
+
+ if code >= 300 then
+ ngx.status = code
+ end
+ ngx.say(body)
+ }
+ }
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 24: check args parse test
+--- request
+GET /echo?args=%40%23%24%25%5E%26
+--- response_body chomp
+args=@#$%^&
+--- no_error_log
+[error]