From 497a2173d717488e4f3cddf65c260f4ca9c3c99b Mon Sep 17 00:00:00 2001 From: Alexander Mironov Date: Sun, 11 Jul 2021 20:31:30 +0400 Subject: [PATCH] Fix parameter discovering in json body --- Cargo.toml | 2 +- src/args.rs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index df5add1..2d3886c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "x8" -version = "2.3.3" +version = "2.3.4" authors = ["Alexander Mironov "] edition = "2018" license = "GPL-3.0-or-later" diff --git a/src/args.rs b/src/args.rs index 9b5ad55..8374ecc 100644 --- a/src/args.rs +++ b/src/args.rs @@ -416,13 +416,11 @@ pub fn get_config() -> (Config, usize) { } if parameter_template.is_empty() { - if body_type.contains("json") && args.is_present("as_body") { + if body_type.contains("json") && args.is_present("as-body") { parameter_template = "\"%k\":\"%v\", "; - } else if body_type.contains("urlencode") { - parameter_template = "%k=%v&"; - } /*else { + } else { parameter_template = "%k=%v&"; - }*/ + } }