Fix port extraction from URL when secure method is called
don't force endpoints for api which doesn't require one