I'm trying to detect https requests made by modifying the following code:
public static boolean isOnHttps(HttpServletRequest request) {
String protoHeader = request.getHeader(Constants.Header.X_FORWARDED_PROTO);
if (null == protoHeader || ! protoHeader.equals("https")) {
return false;
}
return true;
}
The code above fails to detect some of the https requests made, regarding this I have two questions :
What does the parameter of
getHeader
stand for ?What should I do to detect every request made to our servers via https ?
If you can point me towards any direction it would be very helpful. Thx in advance for your time.