Created
September 28, 2011 23:41
-
-
Save kristjan/1249597 to your computer and use it in GitHub Desktop.
Facebook's funny redirect behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Curling some Facebook users' IDs at http://fb.me will send you to their profile | |
$ curl fb.me/6 -D - | |
HTTP/1.1 302 Found | |
Location: http://www.facebook.com/6 | |
Content-Type: text/html; charset=utf-8 | |
X-FB-Server: 10.52.92.83 | |
X-Cnection: close | |
Date: Wed, 28 Sep 2011 23:38:26 GMT | |
Content-Length: 0 | |
# Others don't for some reason | |
$ curl fb.me/204381 -D - | |
HTTP/1.1 302 Found | |
Location: http://www.facebook.com | |
Content-Type: text/html; charset=utf-8 | |
X-FB-Server: 10.52.68.61 | |
X-Cnection: close | |
Date: Wed, 28 Sep 2011 23:37:33 GMT | |
Content-Length: 0 | |
# Something invalid like 0 sends you home too | |
$ curl fb.me/0 -D - | |
HTTP/1.1 302 Found | |
Location: http://www.facebook.com | |
Content-Type: text/html; charset=utf-8 | |
X-FB-Server: 10.54.71.24 | |
X-Cnection: close | |
Date: Wed, 28 Sep 2011 23:36:33 GMT | |
Content-Length: 0 | |
# But apparently ID 1 is Yahoo! | |
$ curl fb.me/1 -D - | |
HTTP/1.1 301 Moved Permanently | |
Location: http://www.yahoo.com | |
Content-Type: text/html; charset=utf-8 | |
X-FB-Server: 10.52.59.69 | |
X-Cnection: close | |
Date: Wed, 28 Sep 2011 23:35:54 GMT | |
Content-Length: 0 |
Aha, never realized they wanted a general tool out of it. How'd you find that particular ID?
Facebook automatically shortens urls for some things. Text message notifications are one example iirc.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Last one is probably left over from when they were testing out the url shortener feature of the domain..
GD-iMac:~ george$ curl fb.me/Dl9CyHL1 -D -
HTTP/1.1 301 Moved Permanently
Location: http://www.youtube.com/watch?v=V2tG1v0lSLQ
Content-Type: text/html; charset=utf-8
X-FB-Server: 10.54.82.42
X-Cnection: close
Date: Wed, 28 Sep 2011 23:52:27 GMT
Content-Length: 0