anchor.diff:    HttpRequest request;
     HttpResponse response;
   
  -  static const String LEAP_LANDING_PAGE = 'samples/leap/index.html';
  +  static const String CONTENT_TYPE = HttpHeaders.CONTENT_TYPE;
  +
  +  static const String LEAP_LANDING_PAGE =
  +      'sdk/lib/_internal/compiler/samples/leap/index.html';
   
     static String landingPage = LEAP_LANDING_PAGE;
   
     Conversation(this.request, this.response);
   
  -  onClosed() {
  +  onClosed(_) {
       if (response.statusCode == HttpStatus.OK) return;
  -    print('Request for ${request.path} ${response.statusCode}');
  +    print('Request for ${request.uri} ${response.statusCode}');
  +  }
  +
  +  setUpErrorHandler() {
  +    // TODO(ahe): When https://codereview.chromium.org/13467004/ lands
  +    // apply the following changes:
  +    // 1. Inline this method in [handle].
  +    // 2. Delete this method.
  +    // 3. Call response.close() instead of calling [done].
  +    // 4. Delete this [done].
  +    response.done
  +      ..then(onClosed)
  +      ..catchError(onError);
     }
   
     done() {
  -    response.outputStream.close();
  -    onClosed();
  +    setUpErrorHandler();
  +    response.close();
     }
   
  -  notFound() {
  +  notFound(path) {
       response.statusCode = HttpStatus.NOT_FOUND;
  +    response.write(htmlInfo('Not Found',
  +                            'The file "$path" could not be found.'));
       done();
     }
   
  
positive.code:   if (arguments.length > 0) {
      Conversation.landingPage = arguments[0];
    }
    var server = new HttpServer();
    var host = '127.0.0.1';
    var port = 8080;
    server.listen(host, port);
    print('HTTP server started on http://$host:$port/');
    server.defaultRequestHandler = Conversation.onRequest;
  }
  
negative.code:   }
  
    handle() {
      String path = request.uri.path;
      if (path == '/') return redirect('/$landingPage');
      if (path == '/favicon.ico') {
        path = '/sdk/lib/_internal/dartdoc/static/favicon.ico';
      }
      if (path.contains('..') || path.contains('%')) return notFound(path);
      var f = new File("./$path");
      f.exists().then((bool exists) {
        if (!exists) return notFound(path);
        if (path.endsWith('.html')) {
          response.headers.set(CONTENT_TYPE, 'text/html');
        } else if (path.endsWith('.dart')) {
          response.headers.set(CONTENT_TYPE, 'application/dart');
        } else if (path.endsWith('.js')) {
          response.headers.set(CONTENT_TYPE, 'application/javascript');
        } else if (path.endsWith('.ico')) {
          response.headers.set(CONTENT_TYPE, 'image/x-icon');
        }
        setUpErrorHandler();
        f.openRead().pipe(response);
      });
    }
  
    static onRequest(HttpRequest request) {
      new Conversation(request, request.response).handle();
    }
  
    static onError(AsyncError e) {
      if (e.error is HttpParserException) {
        print('Error: ${e.error.message}');
      } else {
        print('Error: ${e.error}');
      }
    }
  
    String htmlInfo(String title, String text) {
      return """
  <!DOCTYPE html>
  <html lang='en'>
  <head>
  <title>$title</title>
  </head>
  <body>
  <h1>$title</h1>
  <p>$text</p>
  </body>
  </html>
  """;
    }
  }
  
  