fix(接口测试): 修复自动补充协议头问题
【【接口测试】github#25180,接口自动化场景添加自定义请求时在地址上自动添加了 http://】 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001027348 Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
parent
23b4ac675f
commit
bdc17c8340
|
@ -274,7 +274,7 @@ export default {
|
||||||
if (!this.debugForm.url) return;
|
if (!this.debugForm.url) return;
|
||||||
let url = this.getURL(this.debugForm.url);
|
let url = this.getURL(this.debugForm.url);
|
||||||
if (url && url.pathname) {
|
if (url && url.pathname) {
|
||||||
if (this.debugForm.url.indexOf('?') != -1) {
|
if (this.debugForm.url.indexOf('?') !== -1) {
|
||||||
this.debugForm.url = decodeURIComponent(this.debugForm.url.substr(0, this.debugForm.url.indexOf('?')));
|
this.debugForm.url = decodeURIComponent(this.debugForm.url.substr(0, this.debugForm.url.indexOf('?')));
|
||||||
}
|
}
|
||||||
this.debugForm.path = url.pathname;
|
this.debugForm.path = url.pathname;
|
||||||
|
@ -282,9 +282,6 @@ export default {
|
||||||
this.debugForm.path = url;
|
this.debugForm.path = url;
|
||||||
this.debugForm.url = url;
|
this.debugForm.url = url;
|
||||||
}
|
}
|
||||||
if (!this.debugForm.url.startsWith('http') && !this.debugForm.url.startsWith('https')) {
|
|
||||||
this.debugForm.url = 'http://' + this.debugForm.url;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
getURL(urlStr) {
|
getURL(urlStr) {
|
||||||
try {
|
try {
|
||||||
|
@ -311,9 +308,6 @@ export default {
|
||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!urlStr.startsWith("http") && !urlStr.startsWith("https")) {
|
|
||||||
urlStr = "http://" + urlStr;
|
|
||||||
}
|
|
||||||
return urlStr;
|
return urlStr;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -624,7 +624,7 @@ const message = {
|
||||||
local_selenium_url: 'Local selenium-server URL',
|
local_selenium_url: 'Local selenium-server URL',
|
||||||
file_upload_size: 'File size limit(MB)',
|
file_upload_size: 'File size limit(MB)',
|
||||||
file_upload_size_is_null: 'The file size limit cannot be empty',
|
file_upload_size_is_null: 'The file size limit cannot be empty',
|
||||||
file_upload_tips: 'Please fill in the integer [1-1024]'
|
file_upload_tips: 'Please fill in the integer [1-1024]',
|
||||||
},
|
},
|
||||||
custom_field: {
|
custom_field: {
|
||||||
add_option: 'Add Option',
|
add_option: 'Add Option',
|
||||||
|
@ -1008,10 +1008,10 @@ const message = {
|
||||||
keep_recent: 'Keep',
|
keep_recent: 'Keep',
|
||||||
please_select_cleaning_time: 'please select cleaning time!',
|
please_select_cleaning_time: 'please select cleaning time!',
|
||||||
platform: {
|
platform: {
|
||||||
jira_key_require: "The JIRA project key cannot be null",
|
jira_key_require: 'The JIRA project key cannot be null',
|
||||||
jira_issuetype_require: "The issue type cannot be empty",
|
jira_issuetype_require: 'The issue type cannot be empty',
|
||||||
jira_storytype_require: 'The story type cannot be empty',
|
jira_storytype_require: 'The story type cannot be empty',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
member: {
|
member: {
|
||||||
create: 'Create',
|
create: 'Create',
|
||||||
|
@ -1214,8 +1214,8 @@ const message = {
|
||||||
delete_file_when_uploading: 'The current operation may interrupt the file being uploaded!',
|
delete_file_when_uploading: 'The current operation may interrupt the file being uploaded!',
|
||||||
delete_file_confirm: 'Confirm delete file:',
|
delete_file_confirm: 'Confirm delete file:',
|
||||||
unrelated_file_confirm: 'Confirm unrelated file: ',
|
unrelated_file_confirm: 'Confirm unrelated file: ',
|
||||||
file_size_limit: "Supports any type of file up to {size} MB",
|
file_size_limit: 'Supports any type of file up to {size} MB',
|
||||||
file_size_out_of_bounds: "The file size should not exceed {size} MB",
|
file_size_out_of_bounds: 'The file size should not exceed {size} MB',
|
||||||
delete_file: 'The file already exists, please delete the file with the same name first!',
|
delete_file: 'The file already exists, please delete the file with the same name first!',
|
||||||
thread_num: 'VUs:',
|
thread_num: 'VUs:',
|
||||||
file_type_limit: 'Only files in image format can be uploaded',
|
file_type_limit: 'Only files in image format can be uploaded',
|
||||||
|
@ -1462,7 +1462,7 @@ const message = {
|
||||||
responsible: 'Executor',
|
responsible: 'Executor',
|
||||||
title: 'Create api',
|
title: 'Create api',
|
||||||
path_info: 'Please enter the URL of the interface, such as /api/demo/${id}, where id is the path parameter',
|
path_info: 'Please enter the URL of the interface, such as /api/demo/${id}, where id is the path parameter',
|
||||||
path_all_info: 'Please enter the complete test address',
|
path_all_info: 'Please enter the full URL, including http/https',
|
||||||
fast_debug: 'Fast debug',
|
fast_debug: 'Fast debug',
|
||||||
close_all_label: 'close all label',
|
close_all_label: 'close all label',
|
||||||
save_as: 'Save as new interface',
|
save_as: 'Save as new interface',
|
||||||
|
|
|
@ -622,7 +622,7 @@ const message = {
|
||||||
local_selenium_url: '本地 selenium-server 地址',
|
local_selenium_url: '本地 selenium-server 地址',
|
||||||
file_upload_size: '文件大小限制(MB)',
|
file_upload_size: '文件大小限制(MB)',
|
||||||
file_upload_size_is_null: '文件大小限制不能为空',
|
file_upload_size_is_null: '文件大小限制不能为空',
|
||||||
file_upload_tips: '请填写[1-1024]的整数'
|
file_upload_tips: '请填写[1-1024]的整数',
|
||||||
},
|
},
|
||||||
custom_field: {
|
custom_field: {
|
||||||
add_option: '添加选项',
|
add_option: '添加选项',
|
||||||
|
@ -995,10 +995,10 @@ const message = {
|
||||||
keep_recent: '保留最近',
|
keep_recent: '保留最近',
|
||||||
please_select_cleaning_time: '请选择清理时间!',
|
please_select_cleaning_time: '请选择清理时间!',
|
||||||
platform: {
|
platform: {
|
||||||
jira_key_require: "JIRA项目key不能为空",
|
jira_key_require: 'JIRA项目key不能为空',
|
||||||
jira_issuetype_require: "问题类型不能为空",
|
jira_issuetype_require: '问题类型不能为空',
|
||||||
jira_storytype_require: '需求类型不能为空',
|
jira_storytype_require: '需求类型不能为空',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
member: {
|
member: {
|
||||||
create: '添加成员',
|
create: '添加成员',
|
||||||
|
@ -1444,7 +1444,7 @@ const message = {
|
||||||
responsible: '责任人',
|
responsible: '责任人',
|
||||||
title: '创建接口',
|
title: '创建接口',
|
||||||
path_info: '请输入接口的URL,如/api/demo/${id},其中id为路径参数',
|
path_info: '请输入接口的URL,如/api/demo/${id},其中id为路径参数',
|
||||||
path_all_info: '请输入完整测试地址',
|
path_all_info: '请输入包含 http/https 的完整 URL',
|
||||||
fast_debug: '快捷调试',
|
fast_debug: '快捷调试',
|
||||||
close_all_label: '关闭所有标签',
|
close_all_label: '关闭所有标签',
|
||||||
save_as: '另存为新接口',
|
save_as: '另存为新接口',
|
||||||
|
|
|
@ -621,7 +621,7 @@ const message = {
|
||||||
local_selenium_url: '本地 selenium-server 地址',
|
local_selenium_url: '本地 selenium-server 地址',
|
||||||
file_upload_size: '文件大小限制(MB)',
|
file_upload_size: '文件大小限制(MB)',
|
||||||
file_upload_size_is_null: '文件大小限制不能爲空',
|
file_upload_size_is_null: '文件大小限制不能爲空',
|
||||||
file_upload_tips: '請填寫[1-1024]的整數'
|
file_upload_tips: '請填寫[1-1024]的整數',
|
||||||
},
|
},
|
||||||
custom_field: {
|
custom_field: {
|
||||||
add_option: '添加選項',
|
add_option: '添加選項',
|
||||||
|
@ -994,10 +994,10 @@ const message = {
|
||||||
keep_recent: '保留最近',
|
keep_recent: '保留最近',
|
||||||
please_select_cleaning_time: '請選擇清理時間!',
|
please_select_cleaning_time: '請選擇清理時間!',
|
||||||
platform: {
|
platform: {
|
||||||
jira_key_require: "JIRA項目key不能爲空",
|
jira_key_require: 'JIRA項目key不能爲空',
|
||||||
jira_issuetype_require: "問題類型不能爲空",
|
jira_issuetype_require: '問題類型不能爲空',
|
||||||
jira_storytype_require: '需求類型不能爲空',
|
jira_storytype_require: '需求類型不能爲空',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
member: {
|
member: {
|
||||||
create: '添加成員',
|
create: '添加成員',
|
||||||
|
@ -1443,7 +1443,7 @@ const message = {
|
||||||
responsible: '責任人',
|
responsible: '責任人',
|
||||||
title: '創建接口',
|
title: '創建接口',
|
||||||
path_info: '請輸入接口的URL,如/api/demo/${id},其中id為路徑參數',
|
path_info: '請輸入接口的URL,如/api/demo/${id},其中id為路徑參數',
|
||||||
path_all_info: '請輸入完整測試地址',
|
path_all_info: '請輸入包含 http/https 的完整 URL',
|
||||||
fast_debug: '快捷調試',
|
fast_debug: '快捷調試',
|
||||||
close_all_label: '關閉所有標簽',
|
close_all_label: '關閉所有標簽',
|
||||||
save_as: '另存為新接口',
|
save_as: '另存為新接口',
|
||||||
|
|
Loading…
Reference in New Issue