extern crate hyper;

use hyper::server::{Server, Request, Response};
use hyper::uri::RequestUri;
use hyper::header::ContentType;
use hyper::header;

const HELLO_WORLD: &'static [u8; 13] = b"Hello, World!";

fn main() {
    Server::http("0.0.0.0:8080").unwrap().handle(handler).unwrap();
}

fn handler(req: Request, mut res: Response) {
    match (req.method, req.uri) {
        (hyper::Get, RequestUri::AbsolutePath(ref path)) if path == "/plaintext" => {
            res.headers_mut().set(ContentType::plaintext());
            res.headers_mut().set(header::Server("Hyper".to_owned()));

            res.send(HELLO_WORLD).unwrap();
        }
        _ => (),
    }
}

extern crate hyper;

use hyper::server::{Server, Request, Response};
use hyper::uri::RequestUri;
use hyper::header::ContentType;
use hyper::header;

const HELLO_WORLD: &'static [u8; 13] = b"Hello, World!";

fn main() {
    Server::http("0.0.0.0:8080").unwrap().handle(handler).unwrap();
}

fn handler(req: Request, mut res: Response) {
    match (req.method, req.uri) {
        (hyper::Get, RequestUri::AbsolutePath(ref path)) if path == "/plaintext" => {
            res.headers_mut().set(ContentType("text/plain".parse().unwrap()));
            res.headers_mut().set(header::Server("Hyper".to_owned()));

            res.send(HELLO_WORLD).unwrap();
        }
        _ => (),
    }
}

Fix hyper warning wrt content type
Fix hyper warning wrt content type

Hyper's convenience method produces an extra parameter that the
benchmark doesn't require, so let's build our own without it.
