Fix Request::options() (#177)

This function currently returns a builder set to the DELETE method, most
likely due to a copy / paste related bug.

This patch fixes the builder such that it is correctly set to use the
OPTIONS method.
This commit is contained in:
Carl Lerche
2018-02-28 11:39:38 -08:00
committed by GitHub
parent d2cc923140
commit 7eac2c795d
+2 -1
View File
@@ -311,11 +311,12 @@ impl Request<()> {
/// let request = Request::options("https://www.rust-lang.org/")
/// .body(())
/// .unwrap();
/// # assert_eq!(*request.method(), Method::OPTIONS);
/// ```
pub fn options<T>(uri: T) -> Builder
where Uri: HttpTryFrom<T> {
let mut b = Builder::new();
b.method(Method::DELETE).uri(uri);
b.method(Method::OPTIONS).uri(uri);
b
}