kayx23 opened a new issue, #9493:
URL: https://github.com/apache/apisix/issues/9493

   ### Current Behavior
   
   The field should be used for the originating IP of a client. Currently it 
doesn't check string format.
   
![image](https://github.com/apache/apisix/assets/39619599/9b8efea9-06f4-4e26-b92d-206401f7b06b)
   
   
   ### Expected Behavior
   
   Error out on strings input that are not IPs.
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   ```
   curl "http://127.0.0.1:9180/apisix/admin/routes"; -H "X-API-KEY: xxx" -X PUT 
-d '
   {
     "id": "getting-started-anything",
     "uri": "/anything",
     "upstream" : {
       "type": "roundrobin",
       "nodes": {
         "httpbin.org": 1
       }
     }
   }'
   ```
   ```
   curl http://127.0.0.1:9180/apisix/admin/global_rules/1 -H "X-API-KEY: xxx" 
-X PUT  -d '{
      "plugins":{
         "real-ip":{
            "source": "http_x_forwarded_for"
         }
      }
   }'
   ```
   ```
   curl "http://127.0.0.1:9080/anything"; -H "x_forwarded_for: random-string"
   ```
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to