A
A
Alexander Sharomet2016-12-28 21:04:57
PHP
Alexander Sharomet, 2016-12-28 21:04:57

How to check where a post request came from?

Hello.
I have an api that connects to an angular2 example api/controller.
I send a post request to it. How can I make sure that the data comes from where it is needed, what if someone connects there and throws all sorts of nasty things there or just lays down the base?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-12-28
@sharomet

$_SERVER['REMOTE_ADDR'] is fine?
In general, angular has nothing to do with it. The issue must be resolved on the server. Limit the frequency of requests from one ip, authorization, access to certain sections according to authorization. Yes, and CSRF tokens in the forms.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question