Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
be16dfd8
Commit
be16dfd8
authored
Dec 24, 2018
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance:Modulebg:Request) 发包方式支持 Multipart, 在其它配置里选择
parent
900d18fd
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
2 deletions
+27
-2
CHANGELOG.md
CHANGELOG.md
+2
-0
request.js
modules/request.js
+16
-2
base.js
source/core/base.js
+3
-0
en.js
source/language/en.js
+1
-0
zh.js
source/language/zh.js
+1
-0
form.js
source/modules/shellmanager/list/form.js
+4
-0
No files found.
CHANGELOG.md
View file @
be16dfd8
...
@@ -10,12 +10,14 @@
...
@@ -10,12 +10,14 @@
*
添加 Shell 时 URL 默认前缀
`http://`
*
添加 Shell 时 URL 默认前缀
`http://`
*
添加 Shell 时根据文件后缀选择 Shell 类型并赋予默认编码(asp 默认 GBK, 其它默认 UTF8) #109
*
添加 Shell 时根据文件后缀选择 Shell 类型并赋予默认编码(asp 默认 GBK, 其它默认 UTF8) #109
*
其它配置新增
`Multipart 发包`
功能
### Core
### Core
#### 后端模块
#### 后端模块
*
数据存储新增插件配置存储管理功能 (
`shell-addPluginDataConf`
,
`shell-editPluginDataConf`
,
`shell-delPluginDataConf`
,
`shell-getPluginDataConf`
)
*
数据存储新增插件配置存储管理功能 (
`shell-addPluginDataConf`
,
`shell-editPluginDataConf`
,
`shell-delPluginDataConf`
,
`shell-getPluginDataConf`
)
*
后台发包方式支持
`Multipart`
, 可在Shell其它配置里选择是否开启此功能
### Other
### Other
...
...
modules/request.js
View file @
be16dfd8
...
@@ -99,7 +99,7 @@ class Request {
...
@@ -99,7 +99,7 @@ class Request {
if
(
opts
[
'url'
].
match
(
CONF
.
urlblacklist
))
{
if
(
opts
[
'url'
].
match
(
CONF
.
urlblacklist
))
{
return
event
.
sender
.
send
(
'request-error-'
+
opts
[
'hash'
],
"Blacklist URL"
);
return
event
.
sender
.
send
(
'request-error-'
+
opts
[
'hash'
],
"Blacklist URL"
);
}
}
cons
t
_request
=
superagent
.
post
(
opts
[
'url'
]);
le
t
_request
=
superagent
.
post
(
opts
[
'url'
]);
// 设置headers
// 设置headers
_request
.
set
(
'User-Agent'
,
USER_AGENT
);
_request
.
set
(
'User-Agent'
,
USER_AGENT
);
// 自定义headers
// 自定义headers
...
@@ -108,6 +108,13 @@ class Request {
...
@@ -108,6 +108,13 @@ class Request {
}
}
// 自定义body
// 自定义body
const
_postData
=
Object
.
assign
({},
opts
.
body
,
opts
.
data
);
const
_postData
=
Object
.
assign
({},
opts
.
body
,
opts
.
data
);
// 通过替换函数方式来实现发包方式切换, 后续可改成别的
const
old_send
=
_request
.
send
;
if
(
opts
[
'useMultipart'
]
==
1
)
{
_request
.
send
=
_request
.
field
;
}
else
{
_request
.
send
=
old_send
;
}
_request
_request
.
proxy
(
APROXY_CONF
[
'uri'
])
.
proxy
(
APROXY_CONF
[
'uri'
])
.
type
(
'form'
)
.
type
(
'form'
)
...
@@ -158,7 +165,7 @@ class Request {
...
@@ -158,7 +165,7 @@ class Request {
let
indexEnd
=
-
1
;
let
indexEnd
=
-
1
;
let
tempData
=
[];
let
tempData
=
[];
cons
t
_request
=
superagent
.
post
(
opts
[
'url'
]);
le
t
_request
=
superagent
.
post
(
opts
[
'url'
]);
// 设置headers
// 设置headers
_request
.
set
(
'User-Agent'
,
USER_AGENT
);
_request
.
set
(
'User-Agent'
,
USER_AGENT
);
// 自定义headers
// 自定义headers
...
@@ -167,6 +174,13 @@ class Request {
...
@@ -167,6 +174,13 @@ class Request {
}
}
// 自定义body
// 自定义body
const
_postData
=
Object
.
assign
({},
opts
.
body
,
opts
.
data
);
const
_postData
=
Object
.
assign
({},
opts
.
body
,
opts
.
data
);
// 通过替换函数方式来实现发包方式切换, 后续可改成别的
const
old_send
=
_request
.
send
;
if
(
opts
[
'useMultipart'
]
==
1
)
{
_request
.
send
=
_request
.
field
;
}
else
{
_request
.
send
=
old_send
;
}
_request
_request
.
proxy
(
APROXY_CONF
[
'uri'
])
.
proxy
(
APROXY_CONF
[
'uri'
])
.
type
(
'form'
)
.
type
(
'form'
)
...
...
source/core/base.js
View file @
be16dfd8
...
@@ -244,6 +244,7 @@ class Base {
...
@@ -244,6 +244,7 @@ class Base {
tag_e
:
opt
[
'tag_e'
],
tag_e
:
opt
[
'tag_e'
],
encode
:
this
.
__opts__
[
'encode'
],
encode
:
this
.
__opts__
[
'encode'
],
ignoreHTTPS
:
(
this
.
__opts__
[
'otherConf'
]
||
{})[
'ignore-https'
]
===
1
,
ignoreHTTPS
:
(
this
.
__opts__
[
'otherConf'
]
||
{})[
'ignore-https'
]
===
1
,
useMultipart
:
(
this
.
__opts__
[
'otherConf'
]
||
{})[
'use-multipart'
]
===
1
,
timeout
:
parseInt
((
this
.
__opts__
[
'otherConf'
]
||
{})[
'request-timeout'
]),
timeout
:
parseInt
((
this
.
__opts__
[
'otherConf'
]
||
{})[
'request-timeout'
]),
headers
:
(
this
.
__opts__
[
'httpConf'
]
||
{})[
'headers'
]
||
{},
headers
:
(
this
.
__opts__
[
'httpConf'
]
||
{})[
'headers'
]
||
{},
body
:
(
this
.
__opts__
[
'httpConf'
]
||
{})[
'body'
]
||
{}
body
:
(
this
.
__opts__
[
'httpConf'
]
||
{})[
'body'
]
||
{}
...
@@ -285,6 +286,8 @@ class Base {
...
@@ -285,6 +286,8 @@ class Base {
data
:
opt
[
'data'
],
data
:
opt
[
'data'
],
tag_s
:
opt
[
'tag_s'
],
tag_s
:
opt
[
'tag_s'
],
tag_e
:
opt
[
'tag_e'
],
tag_e
:
opt
[
'tag_e'
],
ignoreHTTPS
:
(
this
.
__opts__
[
'otherConf'
]
||
{})[
'ignore-https'
]
===
1
,
useMultipart
:
(
this
.
__opts__
[
'otherConf'
]
||
{})[
'use-multipart'
]
===
1
,
encode
:
this
.
__opts__
[
'encode'
]
encode
:
this
.
__opts__
[
'encode'
]
});
});
})
})
...
...
source/language/en.js
View file @
be16dfd8
...
@@ -168,6 +168,7 @@ module.exports = {
...
@@ -168,6 +168,7 @@ module.exports = {
},
},
otherConf
:
{
otherConf
:
{
nohttps
:
'Ignore HTTPS certificate'
,
nohttps
:
'Ignore HTTPS certificate'
,
usemultipart
:
'Use Multipart send payload'
,
terminalCache
:
"Use the terminal's cache"
,
terminalCache
:
"Use the terminal's cache"
,
filemanagerCache
:
"Use the filemanager's cache"
,
filemanagerCache
:
"Use the filemanager's cache"
,
uploadFragment
:
"Upload File Fragmentation Size"
,
uploadFragment
:
"Upload File Fragmentation Size"
,
...
...
source/language/zh.js
View file @
be16dfd8
...
@@ -169,6 +169,7 @@ module.exports = {
...
@@ -169,6 +169,7 @@ module.exports = {
},
},
otherConf
:
{
otherConf
:
{
nohttps
:
'忽略HTTPS证书'
,
nohttps
:
'忽略HTTPS证书'
,
usemultipart
:
'使用 Multipart 发包'
,
terminalCache
:
'虚拟终端使用缓存'
,
terminalCache
:
'虚拟终端使用缓存'
,
filemanagerCache
:
'文件管理使用缓存'
,
filemanagerCache
:
'文件管理使用缓存'
,
uploadFragment
:
'上传文件分片大小'
,
uploadFragment
:
'上传文件分片大小'
,
...
...
source/modules/shellmanager/list/form.js
View file @
be16dfd8
...
@@ -317,6 +317,7 @@ class Form {
...
@@ -317,6 +317,7 @@ class Form {
_createOtherForm
(
arg
)
{
_createOtherForm
(
arg
)
{
const
opt
=
Object
.
assign
({},
{
const
opt
=
Object
.
assign
({},
{
'ignore-https'
:
0
,
'ignore-https'
:
0
,
'use-multipart'
:
0
,
'terminal-cache'
:
0
,
'terminal-cache'
:
0
,
'filemanager-cache'
:
1
,
'filemanager-cache'
:
1
,
'upload-fragment'
:
'500'
,
'upload-fragment'
:
'500'
,
...
@@ -330,6 +331,9 @@ class Form {
...
@@ -330,6 +331,9 @@ class Form {
{
{
type
:
"checkbox"
,
name
:
'ignore-https'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'nohttps'
],
type
:
"checkbox"
,
name
:
'ignore-https'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'nohttps'
],
checked
:
opt
[
'ignore-https'
]
===
1
checked
:
opt
[
'ignore-https'
]
===
1
},
{
type
:
"checkbox"
,
name
:
'use-multipart'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'usemultipart'
],
checked
:
opt
[
'use-multipart'
]
===
1
},
{
},
{
type
:
"checkbox"
,
name
:
'terminal-cache'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'terminalCache'
],
type
:
"checkbox"
,
name
:
'terminal-cache'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'terminalCache'
],
checked
:
opt
[
'terminal-cache'
]
===
1
checked
:
opt
[
'terminal-cache'
]
===
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment