aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-09-06 12:16:25 +0700
committerShulhan <ms@kilabit.info>2021-09-06 12:16:25 +0700
commit8cd48204e25078234e340497be6c62ef56cdb993 (patch)
treecefff203c5c8e62a470622a844c6a9b060518713
parent56ec809b41778b95672dce060fd2f6b375619cad (diff)
downloadgorankusu-8cd48204e25078234e340497be6c62ef56cdb993.tar.xz
all: set the original HTTP target if IsCustomizable is true
If the HTTP target IsCustomizable, user can set the request method, path, and/or request type. When user changes those values, the values should overwrite the configuration on server, so the Run method can use it for creating request.
-rw-r--r--run_request.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/run_request.go b/run_request.go
index fa8cb88..bbb4f2d 100644
--- a/run_request.go
+++ b/run_request.go
@@ -48,6 +48,11 @@ func (rr *RunRequest) mergeHttpTarget(env *Environment, origTarget *Target, orig
origTarget.Vars = rr.Target.Vars
rr.Target = origTarget
+ if origHttpTarget.IsCustomizable {
+ origHttpTarget.Method = rr.HttpTarget.Method
+ origHttpTarget.Path = rr.HttpTarget.Path
+ origHttpTarget.RequestType = rr.HttpTarget.RequestType
+ }
origHttpTarget.Headers = rr.HttpTarget.Headers
origHttpTarget.Params = rr.HttpTarget.Params
rr.HttpTarget = origHttpTarget