metamark allows recursive redirects

I just noticed this when adding a ghetto curl-based clipboard one-liner to a hotkey. If I accidentally shorten what's on my clipboard more than once, I get a new URL that redirects to the metamark URL. Do this more than once and you get a string of redirects. I know this is a case of user error, but doesn't it seem to make sense to either refuse to shorten a metamark url or to simply return the same url?

An example: http://xrl.us/or9bt
 
silly I’m unsure
Inappropriate?
6 people have this problem

  • Inappropriate?
    Hi Peter,

    That's weird. It should be blocked actually. There's a bug so you can get around the block by using www.xrl.us, but you didn't do that...

    Are you using the API or the regular interface?
    Sprite_screen 1 person says this solves the problem
  • peter woodman
    Inappropriate?
    I'm using the REST API. Here's the command:

    curl -s --data-urlencode "long_url=`pbpaste`" http://metamark.net/api/rest/simple | pbcopy

    pbcopy/pbpaste are input/output for the OSX clipboard- tried to follow the python example.

    Here's the trace:

    == Info: About to connect() to metamark.net port 80 (#0)
    == Info: Trying 216.52.237.134... == Info: connected
    == Info: Connected to metamark.net (216.52.237.134) port 80 (#0)
    => Send header, 212 bytes (0xd4)
    0000: 50 4f 53 54 20 2f 61 70 69 2f 72 65 73 74 2f 73 POST /api/rest/s
    0010: 69 6d 70 6c 65 20 48 54 54 50 2f 31 2e 31 0d 0a imple HTTP/1.1..
    0020: 55 73 65 72 2d 41 67 65 6e 74 3a 20 63 75 72 6c User-Agent: curl
    0030: 2f 37 2e 31 39 2e 30 20 28 69 33 38 36 2d 61 70 /7.19.0 (i386-ap
    0040: 70 6c 65 2d 64 61 72 77 69 6e 39 2e 34 2e 30 29 ple-darwin9.4.0)
    0050: 20 6c 69 62 63 75 72 6c 2f 37 2e 31 39 2e 30 20 libcurl/7.19.0
    0060: 7a 6c 69 62 2f 31 2e 32 2e 33 0d 0a 48 6f 73 74 zlib/1.2.3..Host
    0070: 3a 20 6d 65 74 61 6d 61 72 6b 2e 6e 65 74 0d 0a : metamark.net..
    0080: 41 63 63 65 70 74 3a 20 2a 2f 2a 0d 0a 43 6f 6e Accept: */*..Con
    0090: 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 32 38 0d tent-Length: 28.
    00a0: 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 61 .Content-Type: a
    00b0: 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d 77 77 77 pplication/x-www
    00c0: 2d 66 6f 72 6d 2d 75 72 6c 65 6e 63 6f 64 65 64 -form-urlencoded
    00d0: 0d 0a 0d 0a ....
    => Send data, 28 bytes (0x1c)
    0000: 6c 6f 6e 67 5f 75 72 6c 3d 68 74 74 70 3a 2f 2f long_url=http://
    0010: 78 72 6c 2e 75 73 2f 6f 72 39 79 33 xrl.us/or9y3
    == Info: HTTP 1.0, assume close after body
    <= Recv header, 17 bytes (0x11)
    0000: 48 54 54 50 2f 31 2e 30 20 32 30 30 20 4f 4b 0d HTTP/1.0 200 OK.
    0010: 0a .
    <= Recv header, 37 bytes (0x25)
    0000: 44 61 74 65 3a 20 46 72 69 2c 20 32 36 20 53 65 Date: Fri, 26 Se
    0010: 70 20 32 30 30 38 20 32 31 3a 30 31 3a 34 37 20 p 2008 21:01:47
    0020: 47 4d 54 0d 0a GMT..
    <= Recv header, 44 bytes (0x2c)
    0000: 53 65 72 76 65 72 3a 20 41 70 61 63 68 65 2f 31 Server: Apache/1
    0010: 2e 33 2e 33 33 20 28 55 6e 69 78 29 20 6d 6f 64 .3.33 (Unix) mod
    0020: 5f 70 65 72 6c 2f 31 2e 32 39 0d 0a _perl/1.29..
    <= Recv header, 77 bytes (0x4d)
    0000: 50 33 50 3a 20 43 50 3d 22 4e 4f 49 20 44 45 56 P3P: CP="NOI DEV
    0010: 6f 20 54 41 49 6f 20 50 53 41 6f 20 50 53 44 6f o TAIo PSAo PSDo
    0020: 20 4f 55 52 20 49 4e 44 20 55 4e 49 20 4e 41 56 OUR IND UNI NAV
    0030: 22 2c 20 70 6f 6c 69 63 79 72 65 66 3d 22 2f 77 ", policyref="/w
    0040: 33 63 2f 70 33 70 2e 78 6d 6c 22 0d 0a 3c/p3p.xml"..
    <= Recv header, 20 bytes (0x14)
    0000: 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 Content-Length:
    0010: 31 39 0d 0a 19..
    <= Recv header, 46 bytes (0x2e)
    0000: 4c 61 73 74 2d 4d 6f 64 69 66 69 65 64 3a 20 46 Last-Modified: F
    0010: 72 69 2c 20 32 36 20 53 65 70 20 32 30 30 38 20 ri, 26 Sep 2008
    0020: 32 31 3a 30 31 3a 34 37 20 47 4d 54 0d 0a 21:01:47 GMT..
    <= Recv header, 33 bytes (0x21)
    0000: 4b 65 65 70 2d 41 6c 69 76 65 3a 20 74 69 6d 65 Keep-Alive: time
    0010: 6f 75 74 3d 33 30 2c 20 6d 61 78 3d 31 30 30 0d out=30, max=100.
    0020: 0a .
    == Info: HTTP/1.0 connection set to keep alive!
    <= Recv header, 24 bytes (0x18)
    0000: 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 6b 65 65 70 Connection: keep
    0010: 2d 61 6c 69 76 65 0d 0a -alive..
    <= Recv header, 41 bytes (0x29)
    0000: 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 Content-Type: te
    0010: 78 74 2f 70 6c 61 69 6e 3b 20 63 68 61 72 73 65 xt/plain; charse
    0020: 74 3d 75 74 66 2d 38 0d 0a t=utf-8..
    <= Recv header, 2 bytes (0x2)
    0000: 0d 0a ..
    <= Recv data, 19 bytes (0x13)
    0000: 68 74 74 70 3a 2f 2f 78 72 6c 2e 75 73 2f 6f 72 http://xrl.us/or
    0010: 39 79 37 9y7
    == Info: Connection #0 to host metamark.net left intact
    == Info: Closing connection #0
    Sprite_screen 1 person says this solves the problem
  • Inappropriate?
    Hi Peter,

    I noticed in the code that the API doesn't have as many restrictions as the regular web interface -- I'll get them back in sync!
User_default_medium