Verification for Ampersands in URLs: The Movie.
Scene 1:
The road is abandoned except for one bold soul careening through the twists and curves of asphalt, his engine crying in mutiny against the silence of the hazy morning. In the man’s rear view mirror, lights flare up out of nowhere in a lively sequence of blue and red that might seem almost festive if they weren’t attached to the roof of a state cruiser. They pull over to the side of the road. Each footstep sounds more contemptuous than the last as the trooper approaches the side of the vehicle.
“Sir, are you aware that you just blew right through 92 validation errors back there?” The trooper says, grimacing as he adjusts his weighty belt.
“What? I mean no… no I wasn’t aware. S-sir.” The man wonders why his reflection looks so scared in the trooper’s sunglasses.
“Seems as though you have a bunch of ampersands that need to be converted to their correct HTML entity ‘&’.” The trooper’s teeth are gritting.
“No… No sir, I wrote everyone out by hand! I promise!”
“Bet you didn’t think to check your href’s… how about on that link you generated off of Google translate? Or on that link from your website host? Leaving the ‘&’ unconverted could cause the link to be broken when the query happens to be an HTML entity as well, like ‘§’, and such. You see, the browser translates ‘&’ to ‘&’ so the server will only see ‘&’ and not ‘&’ in the query string.”
“Shoot, officer, I didn’t know you’re supposed to convert those too.”
“Only every time you use ’em,” scolds the trooper, sounding fatherly. The man feels sorry for whoever might be his kid. “I’m gonna let you off with a warning this time. But don’t let me catch you making the same mistake.”
“No, no, of course not,” the man says, searching for his license and registration. “Never again. I will always be sure to convert any ‘&’ to ‘&’ in the future. Especially in my URLs.”
The man turns back to the window to hand the trooper his information, but the trooper, and his almost festive lights are gone.
Comments (1)
Nicely written Nathan. Thanks for the reminder.
Your Comment