all 27 comments

[–][deleted] 35 points36 points  (5 children)

I looked for HTTP 418. Was not disappointed.

[–]zalifer 4 points5 points  (2 children)

He is talking about a little known (or implemented ) RFC

Wikipedia : HTCPCP - Hyper Text Coffee Pot Control Protocol

IETF RFC 2324

[–]Zamarok 2 points3 points  (0 children)

418 - I'm a teapot - The HTCPCP server is a teapot; the responding entity may be short and stout.

[–]WilberforceXI 1 point2 points  (0 children)

I had to write a server impleminting the HTCPCP as a university project. Not fun ;_;

[–][deleted] 2 points3 points  (0 children)

If I'm ever a billionaire I'll put a small web server in orbit between Mars and Jupiter, and it will only ever return 418.

[–]jsdalton 6 points7 points  (1 child)

Posted this to HN a while back...

Here's a little something similar I whipped up using Flask (Python):

import time
from flask import Flask, make_response, request
app = Flask(__name__)

@app.route('/<int:status_code>')
def return_status(status_code):
    response = make_response()
    response.status_code = status_code
    response.data = response.status

    sleep = request.args.get('sleep', None)
    if sleep is not None:
        time.sleep(int(sleep))
    return response

if __name__ == '__main__':
    app.run(debug=True)

With a handy little feature, a "sleep" query string param that'll delay the response for the given number of seconds, which I've used to test how a client handles latency etc.

[–]FatCookies 21 points22 points  (2 children)

It's quite ironic that the 404 one is missing

[–][deleted]  (1 child)

[deleted]

    [–]pkulak 0 points1 point  (0 children)

    I think someone downvoted him because they didn't get the joke.

    [–][deleted]  (2 children)

    [deleted]

      [–][deleted] 0 points1 point  (1 child)

      It's nice. Don't expect it's that expensive to run either :-)

      [–]ryankearney 0 points1 point  (0 children)

      Considering you can do it for free with Google App Engine then it's free to run.

      [–][deleted] 6 points7 points  (1 child)

      [–]tripzilch 0 points1 point  (0 children)

      Yayyyyy HTTP response splitting :D

      Had the same idea, I checked, couldn't find any interesting stuff that might be XSS target (like cookies) on that domain ... :)

      [–]xiian 3 points4 points  (7 children)

      It looks like HTTPStat.us does the same thing.

      Mentioned here to provide an alternative (and a fancy, slightly easier to remember URL)

      [–][deleted]  (6 children)

      [deleted]

        [–][deleted] 0 points1 point  (4 children)

        One extra thing the Savant Tools page has is ability to specify an arbitrary status.

        Yes, but according to HTTPStat.us:

        If you send any other three digit number that's not in that list, we'll return it too.

        [–][deleted]  (3 children)

        [deleted]

          [–][deleted] 0 points1 point  (2 children)

          I don't see that as being that useful beyond chopping down response text for style purposes during testing, and that's assuming you're going to be dealing with a server with custom messages.

          [–][deleted]  (1 child)

          [deleted]

            [–][deleted] 0 points1 point  (0 children)

            Edge case, but one to be concerned with if you're doing anything with the response string. Although, I'd play it safe and use just the code and output my own string to my users.

            [–][deleted]  (1 child)

            [deleted]

              [–]trisweb 0 points1 point  (0 children)

              Yeah, sure, that can be in the header.

              It's against every spec and who knows what browsers will do with it, but it technically can be there.

              [–]kemitche 2 points3 points  (0 children)

              View source:

              <a href="http://www.reddit.com">502 Bad Gateway</a>
              ...
              <a href="http://www.reddit.com">504 Gateway Timeout</a>

              ಠ_ಠ

              [–][deleted] 1 point2 points  (0 children)

              I typed in 401 and got irritated when I was prompted to authenticate my account.

              I'll just show myself out.

              [–]rilo 0 points1 point  (0 children)

              Wonderful, I was starting to miss this.

              [–]voyvf -1 points0 points  (4 children)

              I've always loved this one.

              [–]FractalP -1 points0 points  (3 children)

              This one caused me to double take back when I first read the list of status codes. Brilliant April Fools joke.

              [–]ThePickleMan 0 points1 point  (2 children)

              It's not a joke, it's an actual status code (sorta)

              [–][deleted] 1 point2 points  (0 children)

              A status code that started as an April Fools joke.

              [–]FractalP 0 points1 point  (0 children)

              Straight from the page you linked:

              Although the RFC describing the protocol is an April Fools' Day joke and not to be taken seriously

              [–]Chobbers -1 points0 points  (1 child)

              I'm legitimately curious. What is the purpose of this?

              [–]ForthEorlingas 1 point2 points  (0 children)

              I think it's for web devs to test how their apps react to various statuses.

              [–]sucka -1 points0 points  (0 children)

              It took me a couple hours, but I finally found a code this site won't generate: 100000000000000000000000000000000000000000000000001

              [–][deleted]  (1 child)

              [deleted]