TinyURL Updated

If you're using my TinyURL utility that I originally described here, you'll need to grab the latest bits in order for the utility to continue working. It stopped working sometime this month (thanks to Medardas for bringing it to my attention). I had guessed it was due to some small change in the HTML response from tinyurl.com that was confounding my regular expression search for the result. But it turned out to be due to an HTTP 417 error ("Expectation failed") that was being returned by the server in response to the POST my utility makes.
 
In particular, the POST request my app was making included an Expect=100-continue header that needed to be removed. Unfortunately, I don't have any packet traces of my original development effort that would confirm who's side of the HTTP conversation changed. Did a recent Windows update cause a change in behavior of the .NET Framework's implementation of HttpWebRequest (and/or supporting code)? Or did tinyurl.com's server-side software undergo an update? I have no idea (not that it matters, other than satisfying my curiosity).
 
At any rate, once I diagnosed the issue with some help from Ethereal, the fix was an easy one. I just needed to turn off the 100-continue expectation on my side of the conversation before sending my request:
 
 
With that fix in place, everything is back in working order.  So be sure to grab the updated bits before your next CTRL-SHIFT-T.

Posted Feb 22 2006, 11:10 AM by mike-woodring

Comments

Steve Johnson wrote re: TinyURL Updated
on 02-22-2006 8:46 AM
HttpWebRequest has been setting Expect: 100-Continue for HTTP/1.1 requests as long as I can remember (I'd like to say always), so I don't think anything on the client has changed.
Daniel wrote re: TinyURL Updated
on 03-04-2006 10:50 PM
I love this! Was complaining about wanting an automated TinyURL then searched and found it. Yay.

Problem: query string parameters are not encoded properly. I was able to TinyURL-ify this ok at tinyurl.com but the second parameter is dropped by your tool.

http://www.eclipse.org/org/elections/candidate.php?year=2006&id=ssmith

Mike wrote re: TinyURL Updated
on 03-06-2006 7:15 AM
This has been fixed. Thanks for bringing the bug to my attention.
an alternative wrote re: TinyURL Updated
on 10-18-2006 5:30 PM
here is an alternative http://www.atomurl.com
Jason Alexander wrote re: TinyURL Updated
on 03-19-2007 8:08 PM
Hey Mike! Thanks so much for this... very handy. FWIW, I just built a Live Writer plugin to encapsulate this: http://jasona.net/archive/2007/03/20/tinyurl-live-writer-plugin.aspx

Julian wrote Another address shortener
on 03-28-2007 8:45 AM
http://xaddr.com is an alternative to TinyURL that works with ftp and mailto links as well.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?