Moved the initialization of self.uri.pathname up and removed the check for self.uri.pathname being falsey.
Also changed the isUrl regex to handle mixed case properly (e.g. ignore it) and added some test cases for that.
Change isUrl regex to accept mixed case
#583 added tests for isUrl regex change.
Moved init of self.uri.pathname
Because the self.uri.pathname var has a default value that is used later in the method, there is no need to check if it is falsey. Just set the pathname to the default if it wasn't set by the user.