Prepare origin URL before parsing to remove incorrect whitespace