POST 请求 - 检测到 406 安全事件
POST request - 406 Security Incident Detected
我正在尝试通过在 POST 请求中提交表单值来从 URL 获取时间表。为此,我在 node-red 中创建了一个流程,并且在几周内运行良好。但是,现在我开始收到以下安全错误。
406 Security Incident Detected
406 Security Incident Detected
Your request was blocked. Please try again later.
XrxWwwzlK-WmpFeEbGejEwAAAEo - www.islamiskaforbundet.se - xxx.xxx.xxx.xxx
有趣的是,当我将参数放入REST开发工具(例如Postman或Open RESTED)和post 请求,我得到了数据没有任何问题。
下面是 Postman 生成的 CURL 请求:
curl -X POST \
https://www.islamiskaforbundet.se/wp-content/plugins/bonetider/Bonetider_Widget.php \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'postman-token: eb701a0e-406e-4851-653f-2b7818c7d455' \
-d 'ifis_bonetider_widget_city=G%C3%B6teborg%2C%20SE&ifis_bonetider_widget_date=2020-05-14'
执行后,终端失败。
可以说服务器可能已经知道了我的 IP 地址并开始阻止所有传入请求,但是为什么相同的请求在上述工具中可以正常工作UI,但在 CURL 还是我的node-red flow?
有什么我遗漏的吗?或者如何避免这个安全错误?
另一端的服务器有多种方法来识别发出请求的客户端,但最有可能的方法是查看来自发出请求的客户端的 User Agent 字符串.
例如您可以通过添加 Firefox 用户代理 header:
来使 curl 命令工作
curl -X POST https://www.islamiskaforbundet.se/wp-content/plugins/bonetider/Bonetider_Widget.php \
-A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0" \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'ifis_bonetider_widget_city=G%C3%B6teborg%2C%20SE&ifis_bonetider_widget_date=2020-05-14'
(我也删除了邮递员令牌)
还有406 is probably the wrong error for the server to be returning, a better match for the text of the error would be something like 429
我正在尝试通过在 POST 请求中提交表单值来从 URL 获取时间表。为此,我在 node-red 中创建了一个流程,并且在几周内运行良好。但是,现在我开始收到以下安全错误。
406 Security Incident Detected
406 Security Incident Detected
Your request was blocked. Please try again later.
XrxWwwzlK-WmpFeEbGejEwAAAEo - www.islamiskaforbundet.se - xxx.xxx.xxx.xxx
有趣的是,当我将参数放入REST开发工具(例如Postman或Open RESTED)和post 请求,我得到了数据没有任何问题。
下面是 Postman 生成的 CURL 请求:
curl -X POST \
https://www.islamiskaforbundet.se/wp-content/plugins/bonetider/Bonetider_Widget.php \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'postman-token: eb701a0e-406e-4851-653f-2b7818c7d455' \
-d 'ifis_bonetider_widget_city=G%C3%B6teborg%2C%20SE&ifis_bonetider_widget_date=2020-05-14'
执行后,终端失败。
可以说服务器可能已经知道了我的 IP 地址并开始阻止所有传入请求,但是为什么相同的请求在上述工具中可以正常工作UI,但在 CURL 还是我的node-red flow?
有什么我遗漏的吗?或者如何避免这个安全错误?
另一端的服务器有多种方法来识别发出请求的客户端,但最有可能的方法是查看来自发出请求的客户端的 User Agent 字符串.
例如您可以通过添加 Firefox 用户代理 header:
来使 curl 命令工作curl -X POST https://www.islamiskaforbundet.se/wp-content/plugins/bonetider/Bonetider_Widget.php \
-A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0" \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'ifis_bonetider_widget_city=G%C3%B6teborg%2C%20SE&ifis_bonetider_widget_date=2020-05-14'
(我也删除了邮递员令牌)
还有406 is probably the wrong error for the server to be returning, a better match for the text of the error would be something like 429