406 Not Acceptable error GET 参数问题? [英] 406 Not Acceptable error GET parameter issue?

查看:35
本文介绍了406 Not Acceptable error GET 参数问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我为什么以下 URL 返回 406 错误:

Can anyone please tell me why the following URL returns a 406 error:

http://kolek.to/functions/remote-upload.php?url=http%3A%2F%2Fben-major.co.uk%2Fhosting%2Fbm-equipment%2Faxe-2.jpg&item_id=2

删除 ?url= 参数似乎使一切正常:

Removing the ?url= parameter seems to make everything fine:

http://kolek.to/functions/remote-upload.php?item_id=2

remote-upload.php的内容如下:

<?php
require_once('../models/api.php');
$request_url = urldecode($_REQUEST['url']);
$item_id = $_REQUEST['item_id'];
echo $item_id;
?>

推荐答案

我认为这是由于来自您服务器的安全过滤器(我在响应头中看到的是 Apache).

I think that this is due to the security filter from your server (I see in the response header that is Apache).

在您的情况下是默认打开的 Apache mod_security.虽然您可以通过在服务器上运行此命令来使用以下内容来诊断问题(关闭过滤器应该可以解决问题):

In your case is Apache mod_security that is turned on by default. While you can use the following to diagnose the problem (turning the filter off should resolve the issue) by running this command on the server:

SecFilterEngine off

但这样做只是为了检查问题是否出在安全过滤器上,我不鼓励关闭过滤器(注入和垃圾邮件攻击的危险).

BUT do this only for checking if the problem is the security filter, I discourage to leave the filter off (danger of injection and spam attacks).

如果您发现这是导致问题的过滤器,请尝试将您的请求放入白名单:这里您可以找到指南和这里 是主要网站.

If you see that is the filter that is the cause of the problem, try to put your request in the whitelist: HERE you can find the guide and HERE is the main website.

这篇关于406 Not Acceptable error GET 参数问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆