https增加短连接扫描配置
This commit is contained in:
parent
05ce4442ce
commit
73bd06beed
@ -58,6 +58,7 @@ namespace FastGithub.Scanner.ScanMiddlewares
|
||||
request.Method = new HttpMethod(rule.Method);
|
||||
request.RequestUri = new Uri(new Uri($"https://{context.Address}"), rule.Path);
|
||||
request.Headers.Host = context.Domain;
|
||||
request.Headers.ConnectionClose = setting.ConnectionClose;
|
||||
|
||||
var timeout = this.options.CurrentValue.Timeout;
|
||||
using var timeoutTokenSource = new CancellationTokenSource(timeout);
|
||||
|
||||
@ -14,6 +14,11 @@ namespace FastGithub.Scanner.ScanMiddlewares
|
||||
/// </summary>
|
||||
public TimeSpan Timeout { get; set; } = TimeSpan.FromSeconds(5d);
|
||||
|
||||
/// <summary>
|
||||
/// 是否使用短连接
|
||||
/// </summary>
|
||||
public bool ConnectionClose { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 各域名扫描规则
|
||||
/// </summary>
|
||||
|
||||
@ -13,14 +13,18 @@
|
||||
},
|
||||
"HttpsScan": {
|
||||
"Timeout": "00:00:05", // https扫描超时时间
|
||||
"ConnectionClose": false, // 是否使用短连接
|
||||
"Rules": {
|
||||
"github.githubassets.com": {
|
||||
"Method": "HEAD",
|
||||
"Path": "/favicons/favicon.png"
|
||||
},
|
||||
"avatars.githubusercontent.com": {
|
||||
"Method": "HEAD",
|
||||
"Path": "/u/8308014?s=40&v=4"
|
||||
},
|
||||
"raw.githubusercontent.com": {
|
||||
"Method": "HEAD",
|
||||
"Path": "/xljiulang/FastGithub/master/README.md"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user