Fixes #83638 by checking if the url ends with "?" or not.