@@ -70,7 +70,7 @@ func preCheckHandler(w http.ResponseWriter, r *http.Request) {
7070}
7171
7272func unboundcheck (u * unbound.Unbound , zone string , typ string ) * result {
73- var errstr string
73+ var errstr string
7474
7575 zone = strings .TrimSpace (zone )
7676 r := new (result )
@@ -92,16 +92,16 @@ var errstr string
9292 return r
9393 }
9494
95- if res .Rcode == 0 {
96- errstr = ""
95+ if res .Rcode == 0 {
96+ errstr = ""
9797 } else {
98- if res .Rcode == 2 {
99- errstr = "(servfail)"
98+ if res .Rcode == 2 {
99+ errstr = "(servfail)"
100100 } else {
101- if res .Rcode == 3 {
102- errstr = "(nxdomain)"
101+ if res .Rcode == 3 {
102+ errstr = "(nxdomain)"
103103 } else {
104- errstr = fmt .Sprintf ("(rcode: %d)" , res .Rcode )
104+ errstr = fmt .Sprintf ("(rcode: %d)" , res .Rcode )
105105 }
106106 }
107107 }
@@ -118,19 +118,19 @@ var errstr string
118118 r .status = "insecure"
119119 }
120120 } else {
121- // r.status = "n/a"
122- if errstr != "" {
123- errstr = " " + errstr
124- }
125- r .err = fmt .Sprintf ("nodata%s" , errstr )
121+ // r.status = "n/a"
122+ if errstr != "" {
123+ errstr = " " + errstr
124+ }
125+ r .err = fmt .Sprintf ("nodata%s" , errstr )
126126 }
127127
128128 return r
129129}
130130
131131// ReST check
132132func checkHandler (w http.ResponseWriter , r * http.Request ) {
133- w .Header ().Set ("Content-Type" , "text/plain" ) // force text to prevent XSS
133+ w .Header ().Set ("Content-Type" , "text/plain" ) // force text to prevent XSS
134134
135135 lg .Printf ("RESTful request from %s\n " , r .RemoteAddr )
136136
@@ -150,7 +150,7 @@ func checkHandler(w http.ResponseWriter, r *http.Request) {
150150
151151// ReST check with a type (copied checkHandler because the functions are small)
152152func checkHandlerType (w http.ResponseWriter , r * http.Request ) {
153- w .Header ().Set ("Content-Type" , "text/plain" ) // force text to prevent XSS
153+ w .Header ().Set ("Content-Type" , "text/plain" ) // force text to prevent XSS
154154
155155 lg .Printf ("RESTful request from %s\n " , r .RemoteAddr )
156156
@@ -170,7 +170,7 @@ func checkHandlerType(w http.ResponseWriter, r *http.Request) {
170170}
171171
172172func parseHandlerCSV (w http.ResponseWriter , r * http.Request ) {
173- w .Header ().Set ("Content-Type" , "text/plain" ) // force text to prevent XSS
173+ w .Header ().Set ("Content-Type" , "text/plain" ) // force text to prevent XSS
174174 lg .Printf ("Upload request from %s\n " , r .RemoteAddr )
175175
176176 f , _ , err := r .FormFile ("domainlist" )
@@ -219,7 +219,6 @@ Check:
219219 }
220220}
221221
222-
223222func form (w http.ResponseWriter , r * http.Request ) {
224223 fmt .Fprint (w , `
225224<!DOCTYPE html>
@@ -383,9 +382,20 @@ func main() {
383382// Setup the resolver and add the root's trust anchor
384383// This one is used for RESTful lookups - they contain detailed errors
385384func setupUnbound (u * unbound.Unbound ) {
386- // u.ResolvConf("/etc/resolv.conf")
385+ // u.ResolvConf("/etc/resolv.conf")
387386 u .AddTa (`;; ANSWER SECTION:
388- . 168307 IN DNSKEY 257 3 8 (
387+ . 172800 IN DNSKEY 257 3 8 (
388+ AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTO
389+ iW1vkIbzxeF3+/4RgWOq7HrxRixHlFlExOLAJr5emLvN
390+ 7SWXgnLh4+B5xQlNVz8Og8kvArMtNROxVQuCaSnIDdD5
391+ LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF0jLHwVN8
392+ efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7
393+ pr+eoZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLY
394+ A4/ilBmSVIzuDWfdRUfhHdY6+cn8HFRm+2hM8AnXGXws
395+ 9555KrUB5qihylGa8subX2Nn6UwNR1AkUTV74bU=
396+ ) ; KSK; alg = RSASHA256; key id = 20326` )
397+ u .AddTa (`;; ANSWER SECTION:
398+ . 172800 IN DNSKEY 257 3 8 (
389399 AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQ
390400 bSEW0O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh
391401 /RStIoO8g0NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWA
@@ -395,4 +405,5 @@ func setupUnbound(u *unbound.Unbound) {
395405 Yl7OyQdXfZ57relSQageu+ipAdTTJ25AsRTAoub8ONGc
396406 LmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1ihz0=
397407 ) ; key id = 19036` )
408+
398409}
0 commit comments