mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-25 00:10:25 +08:00
实现HTTP部分功能
This commit is contained in:
35
internal/nodes/http_request_test.go
Normal file
35
internal/nodes/http_request_test.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package nodes
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
"github.com/iwind/TeaGo/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestHTTPRequest_RedirectToHTTPS(t *testing.T) {
|
||||
a := assert.NewAssertion(t)
|
||||
{
|
||||
req := &HTTPRequest{
|
||||
Server: &serverconfigs.ServerConfig{
|
||||
Web: &serverconfigs.HTTPWebConfig{
|
||||
RedirectToHttps: &serverconfigs.HTTPRedirectToHTTPSConfig{},
|
||||
},
|
||||
},
|
||||
}
|
||||
req.Run()
|
||||
a.IsBool(req.web.RedirectToHttps.IsOn == false)
|
||||
}
|
||||
{
|
||||
req := &HTTPRequest{
|
||||
Server: &serverconfigs.ServerConfig{
|
||||
Web: &serverconfigs.HTTPWebConfig{
|
||||
RedirectToHttps: &serverconfigs.HTTPRedirectToHTTPSConfig{
|
||||
IsOn: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
req.Run()
|
||||
a.IsBool(req.web.RedirectToHttps.IsOn == true)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user