Implemented additional check for using the 'X-Forwarded-Port' header.