This fixes the following: * nil return value checks * handle missing X-Jenkins-CLI-Port scenario more properly * proper HTTP path normalization
CVE-2015-8103