Your URL Has Three Different Spaces, and One of Them Is a Plus Sign

javascript dev.to

The bug report was one line: "phone number search returns whitespace." The request URL was ?q=+8613800138000. The server read it back as " 8613800138000" — a leading space where the country code should be. Nothing in the application code was wrong. The URL was. Here is the part that trips up almost every team: a space has three encodings, and the character + means two different things depending on which component of the URL you are in. 1. + is a space in the query and a literal plus

Read Full Tutorial open_in_new
arrow_back Back to Tutorials