FIX: Don't blow up when trying to parse invalid or non-ASCII URLs (PR #9838)

Follow-up to https://github.com/discourse/discourse/commit/72f139191e9b3aeebeca31ffa8b75977afe5d816

GitHub

The title of this pull request changed from “FIX: Don’t blow up when trying to parseinvalid or non-ASCII URLs” to "FIX: Don’t blow up when trying to parse invalid or non-ASCII URLs

Nitpick, but you don’t actually need this line, because begin doesn’t open a new scope.

This looks fine to me.