improvements on getClientAddressFromHttpRequest