mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-09 03:02:45 +00:00
35a1cf12b6
Previously, the header was erroneously set as 'Content-Type' and not visible to local clients. This commit fixes both of these issues.
16 lines
390 B
Rust
16 lines
390 B
Rust
#[macro_use]
|
|
extern crate rocket;
|
|
|
|
#[get("/")]
|
|
fn index() -> String {
|
|
"Hello, world!".into()
|
|
}
|
|
|
|
#[test]
|
|
fn content_length_header() {
|
|
let rocket = rocket::build().mount("/", routes![index]);
|
|
let client = rocket::local::blocking::Client::debug(rocket).unwrap();
|
|
let response = client.get("/").dispatch();
|
|
assert!(response.headers().get_one("Content-Length").is_some());
|
|
}
|