fix bug on base url determining using https