[go: up one dir, main page]

warp 0.1.13

serve the web at warp speeds
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![deny(warnings)]
extern crate pretty_env_logger;
extern crate warp;

use warp::{http::Uri, Filter};

#[test]
fn redirect_uri() {
    let over_there = warp::any().map(|| warp::redirect(Uri::from_static("/over-there")));

    let req = warp::test::request();
    let resp = req.reply(&over_there);

    assert_eq!(resp.status(), 301);
    assert_eq!(resp.headers()["location"], "/over-there");
}