Yiyiyimu commented on a change in pull request #1979:
URL: https://github.com/apache/apisix/pull/1979#discussion_r502878260
##########
File path: .travis/apisix_cli_test.sh
##########
@@ -211,6 +211,33 @@ fi
echo "passed: worker_shutdown_timeout in nginx.conf is ok"
+# empty allow_admin in conf/config.yaml
+
+git checkout conf/config.yaml
+
+sed -i 's/- 127.0.0.0\/24/- 127.0.0.9/' conf/config.yaml
+
+make init
+
+grep -E "allow 127.0.0.9;" conf/nginx.conf > /dev/null
+if [ ! $? -eq 0 ]; then
+ echo "failed: not found 'allow 127.0.0.9;' in conf/nginx.conf"
+ exit 1
+fi
+
+sed -i 's/- 127.0.0.9/\# - 127.0.0.9/' conf/config.yaml
+
+make init
+
+set +ex
+grep "allow 127.0.0.9;" conf/nginx.conf > /dev/null
+if [ ! $? -eq 1 ]; then
+ echo "failed: found allow 127.0.0.9; in conf/nginx.conf"
+ exit 1
Review comment:
I think we should not check if 127.0.0.9 is in nginx.conf, since it's
commented out, it would never be in nginx.conf, so current version would still
pass this test.
I think we need to test if there is
```
location /apisix/admin {
deny all;
```
which cause this problem.
----------------------------------------------------------------
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]