mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-18 03:35:10 +08:00
HTTP Header:实现请求方法、域名、状态码等限制,实现内容替换功能
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils"
|
||||
"io"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
@@ -129,6 +130,15 @@ func httpRequestGenBoundary() string {
|
||||
return fmt.Sprintf("%x", buf[:])
|
||||
}
|
||||
|
||||
// 判断状态是否为跳转
|
||||
func httpStatusIsRedirect(statusCode int) bool {
|
||||
return statusCode == http.StatusPermanentRedirect ||
|
||||
statusCode == http.StatusTemporaryRedirect ||
|
||||
statusCode == http.StatusMovedPermanently ||
|
||||
statusCode == http.StatusSeeOther ||
|
||||
statusCode == http.StatusFound
|
||||
}
|
||||
|
||||
// 生成请求ID
|
||||
var httpRequestTimestamp int64
|
||||
var httpRequestId int32 = 1_000_000
|
||||
|
||||
Reference in New Issue
Block a user