From 15ac6877a4d791232bfb738cf55c255db800e192 Mon Sep 17 00:00:00 2001 From: coderfengyun Date: Mon, 29 Sep 2014 14:10:11 +0800 Subject: [PATCH] refactor for content type refactor for content type --- .../org/bench4q/agent/plugin/basic/http/HttpPlugin.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/HttpPlugin.java b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/HttpPlugin.java index a70d27fd..0ed6f45b 100644 --- a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/HttpPlugin.java +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/HttpPlugin.java @@ -117,7 +117,7 @@ public class HttpPlugin extends ParameterBarn { return uri; } - @Behavior(value = "Get", type = BehaviorType.USER_BEHAVIOR) + @Behavior(value = "Batch", type = BehaviorType.USER_BEHAVIOR) public List batchRequest( @Parameter(value = "requests", type = SupportTypes.Table) String requests) { ExecutorService executorService = Executors.newFixedThreadPool(2); @@ -248,6 +248,11 @@ public class HttpPlugin extends ParameterBarn { doExtractResponseVariablesAndSave(respVarsToSaveInSession, method.getResponseBodyAsString()); } + int pos = -1; + if (!contentType.isEmpty() + && (pos = contentType.indexOf(';')) != -1) { + contentType = contentType.substring(0, pos).toLowerCase(); + } return new HttpReturn((responseCode % 100) < 4, responseCode, method.getURI().toString(), contentLength, contentType, responseHeaders);