feat: 请求Headers支持变量

This commit is contained in:
Captain.B 2020-08-11 10:05:09 +08:00
parent 22950f0893
commit 8b2041bbd9
1 changed files with 6 additions and 0 deletions

View File

@ -871,6 +871,9 @@ class JMXGenerator {
this.addEnvironments(environment.headers, scenario.headers)
}
let headers = this.filterKV(scenario.headers);
headers.forEach(h => {
h.value = calculate(h.value);
});
if (headers.length > 0) {
let name = scenario.name + " Headers"
threadGroup.put(new HeaderManager(name, headers));
@ -881,6 +884,9 @@ class JMXGenerator {
let name = request.name + " Headers";
this.addBodyFormat(request);
let headers = this.filterKV(request.headers);
headers.forEach(h => {
h.value = calculate(h.value);
});
if (headers.length > 0) {
httpSamplerProxy.put(new HeaderManager(name, headers));
}