From 3ba01a35d657ab29f66a960a4e20136b5c623e78 Mon Sep 17 00:00:00 2001 From: Danny-Dasilva Date: Sat, 17 Feb 2024 01:18:49 -0500 Subject: [PATCH] clean deps --- cycletls/go.mod | 2 - cycletls/go.sum | 5 - .../tests/integration/header_order_test.go | 170 ------------------ 3 files changed, 177 deletions(-) delete mode 100644 cycletls/tests/integration/header_order_test.go diff --git a/cycletls/go.mod b/cycletls/go.mod index 190bed39..436d25df 100644 --- a/cycletls/go.mod +++ b/cycletls/go.mod @@ -4,7 +4,6 @@ go 1.20 require ( github.com/Danny-Dasilva/fhttp v0.0.0-20240217042913-eeeb0b347ce1 - github.com/PuerkitoBio/goquery v1.8.0 github.com/andybalholm/brotli v1.1.0 github.com/gorilla/websocket v1.5.1 github.com/refraction-networking/utls v1.6.2 @@ -13,7 +12,6 @@ require ( ) require ( - github.com/andybalholm/cascadia v1.3.1 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/klauspost/compress v1.17.6 // indirect github.com/quic-go/quic-go v0.41.0 // indirect diff --git a/cycletls/go.sum b/cycletls/go.sum index ba876843..fdbe89a6 100644 --- a/cycletls/go.sum +++ b/cycletls/go.sum @@ -10,13 +10,9 @@ git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGy github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Danny-Dasilva/fhttp v0.0.0-20240217042913-eeeb0b347ce1 h1:/lqhaiz7xdPr6kuaW1tQ/8DdpWdxkdyd9W/6EHz4oRw= github.com/Danny-Dasilva/fhttp v0.0.0-20240217042913-eeeb0b347ce1/go.mod h1:Hvab/V/YKCDXsEpKYKHjAXH5IFOmoq9FsfxjztEqvDc= -github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U= -github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= -github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= -github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= @@ -242,7 +238,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= diff --git a/cycletls/tests/integration/header_order_test.go b/cycletls/tests/integration/header_order_test.go deleted file mode 100644 index 8b60d94a..00000000 --- a/cycletls/tests/integration/header_order_test.go +++ /dev/null @@ -1,170 +0,0 @@ -//go:build integration -// +build integration - -package cycletls_test - -import ( - "encoding/json" - "github.com/PuerkitoBio/goquery" - "log" - "strings" - "testing" - - cycletls "github.com/Danny-Dasilva/CycleTLS/cycletls" -) - -type HttpBinHeaders struct { - Headers map[string]string -} - -//TODO rewrite this so its not reliant on goquery - -// func TestDefaultHeaderOrder(t *testing.T) { -// client := cycletls.Init() - -// resp, err := client.Do("https://pgl.yoyo.org/http/browser-headers.php", cycletls.Options{ -// Body: "", -// Ja3: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513,29-23-24,0", -// UserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36", -// Headers: map[string]string{"host": "pgl.yoyo.org", "connection": "keep-alive", "cache-control": "no-cache"}, -// }, "GET") -// if err != nil { -// log.Print("Request Failed: " + err.Error()) -// } -// doc, err := goquery.NewDocumentFromReader(strings.NewReader(string(resp.Body))) - -// if err != nil { -// log.Fatal("Document read error", err) -// } - -// headername := doc.Find(".headername").Text() -// // headervalue := doc.Find(".headerval").Text() -// expected_order := "User-Agent:Cache-Control:Connection:Host:" - -// if expected_order != headername { -// t.Fatalf("Headers are ordered incorrectly: %s", headername) -// } -// } - -// func TestCustomHeaderOrder(t *testing.T) { -// client := cycletls.Init() -// resp, err := client.Do("https://pgl.yoyo.org/http/browser-headers.php", cycletls.Options{ -// Body: "", -// Ja3: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513,29-23-24,0", -// UserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36", -// Headers: map[string]string{"host": "pgl.yoyo.org", "connection": "keep-alive", "cache-control": "no-cache"}, -// HeaderOrder: []string{"cache-control", "connection", "host"}, -// }, "GET") -// if err != nil { -// log.Print("Request Failed: " + err.Error()) -// } -// doc, err := goquery.NewDocumentFromReader(strings.NewReader(string(resp.Body))) - -// if err != nil { -// log.Fatal("Document read error", err) -// } - -// headername := doc.Find(".headername").Text() -// expected_order := "User-Agent:Host:Connection:Cache-Control:" - -// if expected_order != headername { -// t.Fatalf("Custom Headers are ordered incorrectly: %s", headername) -// } -// } - -// func TestCustomHeaderOrderFailure(t *testing.T) { -// client := cycletls.Init() -// resp, err := client.Do("https://pgl.yoyo.org/http/browser-headers.php", cycletls.Options{ -// Body: "", -// Ja3: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513,29-23-24,0", -// UserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36", -// Headers: map[string]string{"host": "pgl.yoyo.org", "connection": "keep-alive", "cache-control": "no-cache"}, -// HeaderOrder: []string{"cache-control", "connection", "host"}, -// }, "GET") -// if err != nil { -// log.Print("Request Failed: " + err.Error()) -// } -// doc, err := goquery.NewDocumentFromReader(strings.NewReader(string(resp.Body))) - -// if err != nil { -// log.Fatal("Document read error", err) -// } - -// headername := doc.Find(".headername").Text() -// unexpected_order := "User-Agent:Cache-Control:Connection:Host:" - -// if unexpected_order == headername { -// t.Fatalf("Custom Headers Failures are ordered incorrectly: %s", headername) -// } -// } - -// func TestCustomHeadersDefaultOrder(t *testing.T) { -// client := cycletls.Init() -// resp, err := client.Do("https://pgl.yoyo.org/http/browser-headers.php", cycletls.Options{ -// Body: "", -// Ja3: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513,29-23-24,0", -// UserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36", -// Headers: map[string]string{"test1": "value1", "test2": "value2"}, -// }, "GET") -// if err != nil { -// log.Print("Request Failed: " + err.Error()) -// } -// doc, err := goquery.NewDocumentFromReader(strings.NewReader(string(resp.Body))) - -// if err != nil { -// log.Fatal("Document read error", err) -// } - -// headername := doc.Find(".headername").Text() -// unexpected_order := "Accept-Encoding:Test2:Test1:Connection:Host:" - -// if unexpected_order == headername { -// t.Fatalf("Custom Headers Failures are ordered incorrectly: %s", headername) -// } -// } - -// func TestCustomHeadersCustomOrder(t *testing.T) { -// client := cycletls.Init() -// resp, err := client.Do("https://pgl.yoyo.org/http/browser-headers.php", cycletls.Options{ -// Body: "", -// Ja3: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513,29-23-24,0", -// UserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36", -// Headers: map[string]string{"test1": "value1", "test2": "value2"}, -// HeaderOrder: []string{"test2", "test1"}, -// }, "GET") -// if err != nil { -// log.Print("Request Failed: " + err.Error()) -// } -// doc, err := goquery.NewDocumentFromReader(strings.NewReader(string(resp.Body))) - -// if err != nil { -// log.Fatal("Document read error", err) -// } - -// headername := doc.Find(".headername").Text() -// unexpected_order := "Accept-Encoding:Host:Test2:Test1:Connection:" - -// if unexpected_order == headername { -// t.Fatalf("Custom Headers Failures are ordered incorrectly: %s", headername) -// } -// } -// func TestCustomHeaders(t *testing.T) { -// client := cycletls.Init() -// resp, err := client.Do("https://httpbin.org/headers", cycletls.Options{ -// Body: "", -// Ja3: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513,29-23-24,0", -// UserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36", -// Headers: map[string]string{"foo": "bar"}, -// }, "GET") -// if err != nil { -// log.Print("Request Failed: " + err.Error()) -// } -// var result HttpBinHeaders -// err = json.Unmarshal([]byte(resp.Body), &result) -// if err != nil { -// log.Fatal("Unmarshal error", err) -// } -// if result.Headers["Foo"] != "bar" { -// t.Fatalf("Headers not applied") -// } -// }