mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-13 06:50:25 +08:00
修改Partial Content的Bounary值长度(从60字节修改为16字节)
This commit is contained in:
@@ -11,7 +11,7 @@ func TestHTTPRequest_RedirectToHTTPS(t *testing.T) {
|
||||
a := assert.NewAssertion(t)
|
||||
{
|
||||
req := &HTTPRequest{
|
||||
Server: &serverconfigs.ServerConfig{
|
||||
ReqServer: &serverconfigs.ServerConfig{
|
||||
Web: &serverconfigs.HTTPWebConfig{
|
||||
RedirectToHttps: &serverconfigs.HTTPRedirectToHTTPSConfig{},
|
||||
},
|
||||
@@ -22,7 +22,7 @@ func TestHTTPRequest_RedirectToHTTPS(t *testing.T) {
|
||||
}
|
||||
{
|
||||
req := &HTTPRequest{
|
||||
Server: &serverconfigs.ServerConfig{
|
||||
ReqServer: &serverconfigs.ServerConfig{
|
||||
Web: &serverconfigs.HTTPWebConfig{
|
||||
RedirectToHttps: &serverconfigs.HTTPRedirectToHTTPSConfig{
|
||||
IsOn: true,
|
||||
|
||||
@@ -122,7 +122,7 @@ func httpRequestReadRange(reader io.Reader, buf []byte, start int64, end int64,
|
||||
// 生成boundary
|
||||
// 仿照Golang自带的函数(multipart包)
|
||||
func httpRequestGenBoundary() string {
|
||||
var buf [30]byte
|
||||
var buf [8]byte
|
||||
_, err := io.ReadFull(rand.Reader, buf[:])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
@@ -10,6 +10,13 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestHTTPRequest_httpRequestGenBoundary(t *testing.T) {
|
||||
for i := 0; i < 10; i++ {
|
||||
var boundary = httpRequestGenBoundary()
|
||||
t.Log(boundary, "[", len(boundary), "bytes", "]")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTTPRequest_httpRequestParseContentRange(t *testing.T) {
|
||||
a := assert.NewAssertion(t)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user