on 03-19-2014 2:24 PM
Hi ,
How can I fetch IP address from the request in xsjs service?
I tried with this code :
var ipAddress = $.request.headers.get("X-FORWARDED-FOR");
It is working but who ever request for service gives the same IP address.
Please suggest, how we can achieve this.
Thanks & Regards,
Desanth
Could it be that all your users are behind a proxy? Then you would see exactly the proxy IP address in "X-FORWARDED-FOR" as this is how they are all exposed in Internet.
Cheers,
--Vlado
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Desanth,
the question is related more to the web standards than to HANA XS specifics. That is
1) the xsjs code is correct - it obtains the value of the "X-FORWARDED-FOR" request. However ou should consider corner cases:
- note that the header might not exist
- you should consider that TupeList might contain multiple values... see
2) HTTP headers are not reliable as they can be manipulated by the end user. That is the client IP obtained from HTTP request header is not recommended to be used for security relevant decisions (e.g. access control)
Regards,
Svetoslav
User | Count |
---|---|
74 | |
8 | |
8 | |
8 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.