feat: binding ip with session

🛡️staying safe even your frontend was hacked
This commit is contained in:
naiba
2025-10-09 21:36:59 +08:00
parent 1db4fe4679
commit 540c1cb1e7
7 changed files with 109 additions and 17 deletions
+4
View File
@@ -114,6 +114,10 @@ func (provider *Provider) splitDomainSOA(ctx context.Context, domain string) (pr
if soa, ok := r.Answer[0].(*dns.SOA); ok {
zone := soa.Hdr.Name
prefix := libdns.RelativeName(domain, zone)
// Convert "@" to empty string for zone apex
if prefix == "@" {
prefix = ""
}
return prefix, zone, nil
}
}
-5
View File
@@ -2,7 +2,6 @@ package ddns
import (
"context"
"os"
"testing"
)
@@ -13,10 +12,6 @@ type testSt struct {
}
func TestSplitDomainSOA(t *testing.T) {
if ci := os.Getenv("CI"); ci != "" { // skip if test on CI
return
}
cases := []testSt{
{
domain: "www.example.co.uk",