smileby commented on issue #10749:
URL: https://github.com/apache/apisix/issues/10749#issuecomment-1875369473
After adjustment, it will be more flexible for users. Suppose I adjust it
to:
```
return conf.rejected_code, conf.rejected_msg
```
Users can customize the rejected_msg attribute
```
## url-blocker config-1
{
"_meta": {
"disable": false
},
"block_rules": [
"/*"
],
"rejected_code": 200,
"rejected_msg": "{\"error_msg\":\"reject access\"}"
}
## response-1
{"error_msg":"reject access"}
```
It can be like this
```
## url-blocker config-2
{
"_meta": {
"disable": false
},
"block_rules": [
"/*"
],
"rejected_code": 200,
"rejected_msg": "{\"code\":\"400\",\"desc\":\"block\"}"
}
## response-2
{"code":"400", "desc":"block"}
```
Because rejected_code is an http response code, in many scenarios, users may
need a business type response code.
Many non-200 http response codes will cause business failure.
--
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]