mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-03 01:55:27 +00:00
keep all redirects chain, add referrer holder
This commit is contained in:
parent
ff3f064534
commit
ae5399e68e
4 changed files with 58 additions and 74 deletions
|
|
@ -12,28 +12,21 @@ use gtk::glib::GString;
|
|||
/// * `request` - destination
|
||||
/// * currently, it's raw `GString` not [Uri](https://docs.gtk.org/glib/struct.Uri.html)
|
||||
/// because of compatibility with request field as it could contain any other, not parsable values
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Redirect {
|
||||
is_foreground: bool,
|
||||
request: GString,
|
||||
pub is_foreground: bool,
|
||||
pub referrer: Option<GString>,
|
||||
pub request: GString,
|
||||
}
|
||||
|
||||
impl Redirect {
|
||||
// Constructors
|
||||
|
||||
pub fn new(request: GString, is_foreground: bool) -> Self {
|
||||
pub fn new(request: GString, referrer: Option<GString>, is_foreground: bool) -> Self {
|
||||
Self {
|
||||
is_foreground,
|
||||
referrer,
|
||||
request,
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
pub fn request(&self) -> GString {
|
||||
self.request.clone()
|
||||
}
|
||||
|
||||
pub fn is_foreground(&self) -> bool {
|
||||
self.is_foreground
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue