0

I want to get any attribute(url/domain/hostname) of the origin server from which request arises when I am re-directed to some other server.

For Ex: I am on applciation say abc.com and from this, I am re-directed to pqr.com, when I am on this server how can I get the server information of the origin server so that I can put some check and execute code in java.

Manan Kapoor
  • 675
  • 1
  • 11
  • 28
  • 1
    I think you can use the HTTP referer header value. Check https://stackoverflow.com/questions/2648984/httpservletrequest-how-to-obtain-the-referring-url – Manish Apr 27 '18 at 11:50

1 Answers1

0

You can try to read the HTTP Referer header [sic] but this can be disabled on the client side (or obfuscated through server tricks on the origin server), and not all clients send one. So you need to have code to handle the cases when no Referer header is set, or it's set to some unexpected URL.

Robin Green
  • 32,079
  • 16
  • 104
  • 187