mirror of
https://github.com/openharmony/third_party_rust_http.git
synced 2026-07-19 14:43:33 -04:00
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:
+2
-1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user