Fix performance issue in URLUtils that may take seconds to canonicalize url.