【发布时间】:2018-03-16 20:40:58
【问题描述】:
我已为 codeigniter 应用程序启用 CSRF 保护。添加和排除了许多 URL,但其中 2 个出现“不允许您请求的操作”错误,而其他 URL 工作正常
if (stripos($_SERVER["REQUEST_URI"],'api/controller1/index') == FALSE &&
stripos($_SERVER["REQUEST_URI"],'api/controller2/index') == FALSE
//URLs here
) {
$config['csrf_protection'] = TRUE;
}else{
$config['csrf_protection'] = FALSE;
}
$config['csrf_exclude_uris'] = array(
'api/controller1/index',
'api/controller2/index',
//URLs here
);
那么如何解决这个问题呢?
【问题讨论】:
标签: codeigniter csrf-protection