From 398819dbf788636a80577a75e6413d9a014d9004 Mon Sep 17 00:00:00 2001 From: Alexander Mironov Date: Mon, 31 Jan 2022 22:41:52 +0300 Subject: [PATCH] Fix detection of reflected parameters (thanks @HolyBugx for this one) --- Cargo.toml | 2 +- src/requests.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3cc8a70..5b3f139 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "x8" -version = "3.2.0" +version = "3.2.1" authors = ["Alexander Mironov "] edition = "2018" license = "GPL-3.0-or-later" diff --git a/src/requests.rs b/src/requests.rs index 9905a9e..ad299fe 100644 --- a/src/requests.rs +++ b/src/requests.rs @@ -297,14 +297,6 @@ pub async fn request( Err(_) => String::new(), }; - let mut reflected_params: Vec = Vec::new(); - - for (key, value) in initial_query.iter() { - if value.contains("%random%_") && body.to_ascii_lowercase().matches(&value.replace("%random%_", "").as_str()).count() as usize != reflections { - reflected_params.push(key.to_string()); - } - } - let mut text = String::new(); for (key, value) in headers.iter() { text.push_str(&key); @@ -315,6 +307,14 @@ pub async fn request( text.push_str(&"\n\n"); text.push_str(&body); + let mut reflected_params: Vec = Vec::new(); + + for (key, value) in initial_query.iter() { + if value.contains("%random%_") && text.to_ascii_lowercase().matches(&value.replace("%random%_", "").as_str()).count() as usize != reflections { + reflected_params.push(key.to_string()); + } + } + ResponseData { text, code,