rapid7/metasploit-framework — pull request #2435 by TsCl (2013-09-28 15:23:00+00:00)
Title: << would cause 'P' (charcode 80) to be printed instead '80' in port number

Using '<<' doesn't actually append the port number in the url string, but a letter from charcode (here, 'P' instead of '80').
Converting the port number to a string before appending it tot he url fixes the issue.