Some small fixes
This commit is contained in:
parent
a34cf6798a
commit
179a68fbec
|
@ -1480,7 +1480,7 @@ func TestParseCAA(t *testing.T) {
|
|||
|
||||
func TestParseURI(t *testing.T) {
|
||||
lt := map[string]string{
|
||||
"_http._tcp IN URI 10 1 \"http://www.example.com/path\"": "_http._tcp\t3600\tIN\tURI\t10 1 \"http://www.example.com/path\"",
|
||||
"_http._tcp. IN URI 10 1 \"http://www.example.com/path\"": "_http._tcp.\t3600\tIN\tURI\t10 1 \"http://www.example.com/path\"",
|
||||
}
|
||||
for i, o := range lt {
|
||||
rr, err := NewRR(i)
|
||||
|
|
2
types.go
2
types.go
|
@ -1337,7 +1337,7 @@ func (rr *URI) copy() RR { return &URI{*rr.Hdr.copyHeader(), rr.Weight
|
|||
func (rr *URI) len() int { return rr.Hdr.len() + 4 + len(rr.Target) }
|
||||
func (rr *URI) String() string {
|
||||
return rr.Hdr.String() + strconv.Itoa(int(rr.Priority)) +
|
||||
" " + strconv.Itoa(int(rr.Weight)) + sprintTxtOctet(rr.Target)
|
||||
" " + strconv.Itoa(int(rr.Weight)) + " " + sprintTxtOctet(rr.Target)
|
||||
}
|
||||
|
||||
type DHCID struct {
|
||||
|
|
|
@ -1890,9 +1890,9 @@ func setURI(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) {
|
|||
rr.Weight = uint16(i)
|
||||
|
||||
<-c // zBlank
|
||||
s, e, c1 := endingToTxtSlice(c, "bad URI Target", f)
|
||||
if e != nil {
|
||||
return nil, e.(*ParseError), ""
|
||||
s, err, c1 := endingToTxtSlice(c, "bad URI Target", f)
|
||||
if err != nil {
|
||||
return nil, err, ""
|
||||
}
|
||||
rr.Target = s[0]
|
||||
return rr, nil, c1
|
||||
|
@ -2180,7 +2180,7 @@ func setCAA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) {
|
|||
}
|
||||
rr.Flag = uint8(i)
|
||||
|
||||
<-c // zBlank
|
||||
<-c // zBlank
|
||||
l = <-c // zString
|
||||
if l.value != zString {
|
||||
return nil, &ParseError{f, "bad CAA Tag", l}, ""
|
||||
|
|
Loading…
Reference in New Issue