-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:Redirects trapped in dead loop detection
- Loading branch information
1 parent
2766a00
commit 7eec740
Showing
21 changed files
with
345 additions
and
204 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "http-request" | ||
version = "3.1.0" | ||
version = "3.2.0" | ||
edition = "2021" | ||
authors = ["ltpp-universe <[email protected]>"] | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// The name of the application. | ||
pub static APP_NAME: &str = "http-request"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod common; | ||
pub mod http; | ||
pub mod request; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
use super::r#type::Config; | ||
use crate::{constant::request::DEFAULT_TIMEOUT, request::request_url::r#type::RequestUrl}; | ||
use crate::{ | ||
constant::request::DEFAULT_TIMEOUT, | ||
request::{http_version::r#type::HttpVersion, request_url::r#type::RequestUrl}, | ||
}; | ||
|
||
impl Default for Config { | ||
/// Provides the default configuration for `Config`. | ||
/// | ||
/// This method initializes a `Config` instance with default values: | ||
/// - `timeout`: Set to the constant `DEFAULT_TIMEOUT`. | ||
/// - `url_obj`: Initialized with the default value of `RequestUrl`. | ||
/// - `redirect`: Set to `false` to disable redirects by default. | ||
/// - `max_redirect_times`: Set to `8` to limit the number of allowed redirects. | ||
/// - `redirect_times`: Set to `0` indicating no redirects have been made. | ||
/// - `http_version`: Set to the default value of `HttpVersion`. | ||
/// | ||
/// # Returns | ||
/// Returns a `Config` instance with the default settings. | ||
fn default() -> Self { | ||
Config { | ||
timeout: DEFAULT_TIMEOUT, | ||
url_obj: RequestUrl::default(), | ||
redirect: false, | ||
max_redirect_times: 8, | ||
redirect_times: 0, | ||
http_version: HttpVersion::default(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.