Chris
Chris

Reputation: 2907

AppEngine Get HOST of incoming request

I have an API and would like to check that I only process requests from certain hosts, using self.request.host always brings back the current API host, not the requesting URL's host...any ideas?

Thanks

Upvotes: 1

Views: 623

Answers (2)

Adam Crossland
Adam Crossland

Reputation: 14213

The Request object has a property called remote_addr that should give you IP address of the origin of the request. See the docs.

Upvotes: 4

Deepak Sathya
Deepak Sathya

Reputation: 43

Do you mean referer?

self.request.headers.get("Referer")

Upvotes: -1

Related Questions