mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-05 09:30:26 +08:00
21 lines
457 B
Go
21 lines
457 B
Go
|
|
package checkpoints
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||
|
|
"net/http"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestRequestHostCheckpoint_RequestValue(t *testing.T) {
|
||
|
|
rawReq, err := http.NewRequest(http.MethodGet, "https://teaos.cn/?name=lu", nil)
|
||
|
|
if err != nil {
|
||
|
|
t.Fatal(err)
|
||
|
|
}
|
||
|
|
|
||
|
|
req := requests.NewRequest(rawReq)
|
||
|
|
req.Header.Set("Host", "cloud.teaos.cn")
|
||
|
|
|
||
|
|
checkpoint := new(RequestHostCheckpoint)
|
||
|
|
t.Log(checkpoint.RequestValue(req, "", nil))
|
||
|
|
}
|