mirror of
https://github.com/projectdiscovery/httpx
synced 2026-06-08 16:50:17 +00:00
f08a003d29
Found via `codespell -L ines,te,ue,occured,ans`
30 lines
518 B
Go
30 lines
518 B
Go
package httpx
|
|
|
|
import (
|
|
_ "embed"
|
|
"sort"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
//go:embed test-data/hackerone.html
|
|
var rawResponse string
|
|
|
|
func TestBodyGrabDoamins(t *testing.T) {
|
|
ht, err := New(&DefaultOptions)
|
|
require.Nil(t, err)
|
|
response := &Response{
|
|
Raw: rawResponse,
|
|
}
|
|
bd := ht.BodyDomainGrab(response)
|
|
|
|
sort.Strings(bd.Domains)
|
|
sort.Strings(bd.Fqdns)
|
|
|
|
t.Run("body domain grab", func(t *testing.T) {
|
|
require.Equal(t, 24, len(bd.Domains))
|
|
require.Equal(t, 16, len(bd.Fqdns))
|
|
})
|
|
}
|