If I will execute request.getRemoteHost() and request.getHeader("HOST") on a Java server will these methods return the same values?
According to the documentation yes, but I will be happy for the confirmation:
https://tomcat.apache.org/tomcat-9.0-doc/servletapi/javax/servlet/ServletRequest.html#getRemoteHost--
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host