MCPcopy
hub / github.com/gofiber/fiber / Test_Domain_Security_InvalidDomainChars

Function Test_Domain_Security_InvalidDomainChars

domain_test.go:1606–1620  ·  view source on GitHub ↗

Test_Domain_Security_InvalidDomainChars tests that invalid domain characters are rejected

(t *testing.T)

Source from the content-addressed store, hash-verified

1604
1605// Test_Domain_Security_InvalidDomainChars tests that invalid domain characters are rejected
1606func Test_Domain_Security_InvalidDomainChars(t *testing.T) {
1607 t.Parallel()
1608
1609 require.Panics(t, func() {
1610 parseDomainPattern("example$.com")
1611 })
1612
1613 require.Panics(t, func() {
1614 parseDomainPattern("example@domain.com")
1615 })
1616
1617 require.Panics(t, func() {
1618 parseDomainPattern("example domain.com")
1619 })
1620}
1621
1622// Test_Domain_Security_TooManyParts tests DoS protection against excessive domain labels
1623func Test_Domain_Security_TooManyParts(t *testing.T) {

Callers

nothing calls this directly

Calls 1

parseDomainPatternFunction · 0.85

Tested by

no test coverage detected