同时设置Websocket允许来源域和防盗链时,以Websocket设置为优先

This commit is contained in:
刘祥超
2023-06-16 09:56:37 +08:00
parent 83ac62cda3
commit ac2d57d2f1
5 changed files with 54 additions and 7 deletions

View File

@@ -145,6 +145,23 @@ func TestHTTPRequest_httpRequestNextId_Concurrent(t *testing.T) {
a.IsTrue(countDuplicated == 0)
}
func TestHTTPParseURL(t *testing.T) {
for _, s := range []string{
"",
"null",
"example.com",
"https://example.com",
"https://example.com/hello",
} {
host, err := httpParseHost(s)
if err == nil {
t.Log(s, "=>", host)
} else {
t.Log(s, "=>")
}
}
}
func BenchmarkHTTPRequest_httpRequestNextId(b *testing.B) {
runtime.GOMAXPROCS(1)