You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2019/12/18 09:59:02 UTC
[GitHub] [incubator-apisix] 1996yarbrough opened a new issue #984: bug: A
document description error :
incubator-apisix/doc/plugins/ip-restriction-cn.md
1996yarbrough opened a new issue #984: bug: A document description error : incubator-apisix/doc/plugins/ip-restriction-cn.md
URL: https://github.com/apache/incubator-apisix/issues/984
### Issue description
The test case for the 'ip-restriction' plug-in is wrong.
I think you should only change client IP, request segment IP unchanged,
such as
$ curl http://127.0.0.1:9080/index.html
HTTP/1.1 200 OK
...
$ curl http://127.0.0.2:9080/index.html -i
HTTP/1.1 403 Forbidden
...
{"message":"Your IP address is not allowed"}
### What's the expected result?
1.
curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
{
"uri": "/index.html",
"upstream": {
"type": "roundrobin",
"nodes": {
"127.0.0.1:1980": 1
}
},
"plugins": {
"ip-restriction": {
"whitelist": [
"127.0.0.1",
"113.74.26.106/24"
]
}
}
}'
2.
$ curl http://127.0.0.1:9080/index.html
HTTP/1.1 200 OK
...
3.
curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
{
"uri": "/index.html",
"upstream": {
"type": "roundrobin",
"nodes": {
"127.0.0.1:1980": 1
}
},
"plugins": {
"ip-restriction": {
"whitelist": [
"127.0.0.2",
"113.74.26.106/24"
]
}
}
}'
4.
$ curl http://127.0.0.1:9080/index.html -i
HTTP/1.1 403 Forbidden
...
{"message":"Your IP address is not allowed"}
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] moonming closed issue #984: bug: A document
description error : incubator-apisix/doc/plugins/ip-restriction-cn.md
Posted by GitBox <gi...@apache.org>.
moonming closed issue #984: bug: A document description error : incubator-apisix/doc/plugins/ip-restriction-cn.md
URL: https://github.com/apache/incubator-apisix/issues/984
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services