fix (接口测试): 修复自定义变量为全路径,环境中不配置url信息执行多出http:/

--bug=1008494 --user=赵勇 [github#8244] url不能完全使用环境变量或参数形式 https://www.tapd.cn/55049933/s/1077354
This commit is contained in:
fit2-zhao 2021-12-02 15:31:36 +08:00 committed by fit2-zhao
parent 5842bde643
commit aee9594dfc
1 changed files with 3 additions and 0 deletions

View File

@ -112,6 +112,9 @@ public final class HTTPSamplerProxy extends HTTPSamplerBase implements Interrupt
}
try {
String url = toExternalForm(u);
if (StringUtils.isNotEmpty(url) && url.startsWith("http:/http")) {
url = url.substring(6);
}
u = new URL(url);
} catch (Exception ex) {
LogUtil.error(ex);