mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
fix redirection info reset
This commit is contained in:
parent
0d202a866a
commit
01ea693c03
12 changed files with 59 additions and 36 deletions
|
|
@ -73,7 +73,10 @@ impl Info {
|
|||
|
||||
/// Reset `Self` to the clean state
|
||||
/// * this method keeps `Redirect` value!
|
||||
pub fn reset(&mut self) -> &mut Self {
|
||||
pub fn reset(&mut self, is_unset_redirect: bool) -> &mut Self {
|
||||
if is_unset_redirect {
|
||||
self.set_redirect(None);
|
||||
}
|
||||
self.clear_events()
|
||||
.set_header(None)
|
||||
.set_mime(None)
|
||||
|
|
@ -102,6 +105,11 @@ impl Info {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn set_redirect(&mut self, redirect: Option<Redirect>) -> &mut Self {
|
||||
self.redirect = redirect;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn set_socket(&mut self, address: Option<(SocketAddress, SocketAddress)>) -> &mut Self {
|
||||
self.socket = address.map(|(local_address, remote_address)| Socket {
|
||||
local_address,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue