juzhiyuan commented on a change in pull request #2708:
URL: https://github.com/apache/apisix/pull/2708#discussion_r522165267
##########
File path: t/plugin/http-logger.t
##########
@@ -595,3 +595,43 @@ hello1 world
--- error_log
Batch Processor[http logger] failed to process entries: failed to connect to
host[127.0.0.1] port[9991] connection refused
--- wait: 1.5
+
+
+
+=== TEST 16: check uri
+--- config
+ location /t {
+ content_by_lua_block {
+ local plugin = require("apisix.plugins.http-logger")
+ local bad_uris = {
+ "127.0.0.1",
+ "127.0.0.1:1024",
+ }
+ for _, bad in ipairs(bad_uris) do
Review comment:
`bad_uri` would be more semantic
##########
File path: t/plugin/http-logger.t
##########
@@ -595,3 +595,43 @@ hello1 world
--- error_log
Batch Processor[http logger] failed to process entries: failed to connect to
host[127.0.0.1] port[9991] connection refused
--- wait: 1.5
+
+
+
+=== TEST 16: check uri
+--- config
+ location /t {
+ content_by_lua_block {
+ local plugin = require("apisix.plugins.http-logger")
+ local bad_uris = {
+ "127.0.0.1",
+ "127.0.0.1:1024",
+ }
+ for _, bad in ipairs(bad_uris) do
+ local ok, err = plugin.check_schema({uri = bad})
+ if ok then
+ ngx.say("mismatched ", bad)
+ end
+ end
+
+ local good_uris = {
+ "http://127.0.0.1:1024",
Review comment:
BTW, according to this RFC[1], would what pattern work for uris that
have queries or params?
[1] https://tools.ietf.org/html/rfc3986#section-3
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]