How to deny direct access to files in AJAX directory

前端 未结 3 1224
春和景丽
春和景丽 2021-01-16 05:46

I have several pages that call in content via jQuery .ajax. I dont want the content visible on the page so thats why I went with .ajax and not showing/hiding the content. I

3条回答
  •  [愿得一人]
    2021-01-16 06:22

    I would drop this idea because there is no secure way to do it.

    Your server will never be able to tell apart a "real" Ajax request from a "faked" one, as every aspect of the request can be forged on client side. An attacker will just have to look into a packet filter to see what requests your page makes. It is trivial to replicate the requests.

    Any solution you work out will do nothing but provide a false sense of security. If you have data you need to keep secret, you will need to employ some more efficient protection like authentication.

提交回复
热议问题