1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

NS1: Improve NS1_URLFWD handling (#2015)

This commit is contained in:
Costas Drogos
2023-01-30 04:01:41 +01:00
committed by GitHub
parent 947efef612
commit 7ed849d10d
4 changed files with 41 additions and 3 deletions

View File

@ -496,6 +496,10 @@ func tlsa(name string, usage, selector, matchingtype uint8, target string) *mode
return r
}
func urlfwd(name, target string) *models.RecordConfig {
return makeRec(name, target, "URLFWD")
}
func ignoreName(name string) *models.RecordConfig {
r := &models.RecordConfig{
Type: "IGNORE_NAME",
@ -917,6 +921,12 @@ func makeTests(t *testing.T) []*TestGroup {
tc("Update 1200 records", manyA("rec%04d", "1.2.3.5", 1200)...),
),
testgroup("NS1_URLFWD tests",
only("NS1"),
tc("Add a urlfwd", urlfwd("urlfwd1", "/ http://example.com 302 2 0")),
tc("Update a urlfwd", urlfwd("urlfwd1", "/ http://example.org 301 2 0")),
),
//
// CanUse* types:
//