I have a servlet, is it possible to check if a request came from a specific domain, say "example.com"?
public abstract class MyServlet extends HttpServlet {
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
if (didOriginateFrom("example.com", req)) {
// ok to process
}
}
}
I have one server that will offload some work to a secondary server (above), just want to make sure it only process requests that come from my primary server,
Thanks