修复cookie不能使用表达式的BUG

This commit is contained in:
mxd 2019-12-21 00:53:38 +08:00
parent c61f30fa85
commit 52e45e04ec

View File

@ -168,6 +168,15 @@ public class RequestExecutor implements ShapeExecutor,Grammerable{
//设置本节点Cookie
cookies = getRequestCookie(request, node.getListJsonValue(COOKIE_NAME, COOKIE_VALUE), context, variables);
if(!cookies.isEmpty()){
cookies.entrySet().forEach(entry->{
try {
Object value = engine.execute(entry.getValue(), variables);
entry.setValue(Objects.toString(value));
} catch (Exception e) {
context.error("设置Cookie出错:{}",e);
}
});
context.debug("设置Cookie{}", cookies);
request.cookies(cookies);
}