How to make sure that my AJAX requests are originating from the same server in Python

后端 未结 8 1860
故里飘歌
故里飘歌 2021-01-31 18:30

I have already asked a question about IP Authentication here: TastyPie Authentication from the same server

However, I need something more! An IP address could be very e

8条回答
  •  情深已故
    2021-01-31 19:06

    As suggested by Venkatesh Bachu, Same Origin Policy and http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing (CORS) could be used as a solution. In your API, you can check Origin header and respond accordingly. Need to check if Origin header can be modified by using extensions like tamper data. A determined hacker can still snoop by pointing browser to a local proxy server.

提交回复
热议问题