只允许不直接通过AJAX访问吗? [英] Allow access through AJAX only not directly?

查看:56
本文介绍了只允许不直接通过AJAX访问吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法只允许调用通过AJAX进入脚本,而不允许最终用户直接访问页面?

Is there a way to only allow calls to come into a script through AJAX and not allow end users to access the page directly?

推荐答案

简短的回答:不.

长答案:AJAX绝对类似于对URL的直接"访问.它们之间实际上没有任何区别.其实有:只有一个头很容易伪造

Long answer: AJAX is absolutely similar to "direct" access to the url. There is literally no difference between them. Actually there is: only one header that can be forged easily

这篇关于只允许不直接通过AJAX访问吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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