git » dnss » commit d4c2d8e

dnss: Add -testing__insecure_http flag, for testing

author Alberto Bertogli
2018-04-07 10:32:41 UTC
committer Alberto Bertogli
2018-04-08 08:33:40 UTC
parent 604b52e9f21bf25a5d67933eff4f8d247e8e6f9e

dnss: Add -testing__insecure_http flag, for testing

This patch adds a -testing__insecure_http flag that can be used to
simplify integration and manual testing.

dnss.go +7 -0

diff --git a/dnss.go b/dnss.go
index cff5166..569a8bb 100644
--- a/dnss.go
+++ b/dnss.go
@@ -66,6 +66,9 @@ var (
 		"how often to flush logs")
 	monitoringListenAddr = flag.String("monitoring_listen_addr", "",
 		"address to listen on for monitoring HTTP requests")
+
+	insecureForTesting = flag.Bool("testing__insecure_http", false,
+		"INSECURE, for testing only")
 )
 
 func flushLogs() {
@@ -93,6 +96,10 @@ func main() {
 		glog.Fatal("")
 	}
 
+	if *insecureForTesting {
+		httpstodns.InsecureForTesting = true
+	}
+
 	var wg sync.WaitGroup
 
 	// DNS to HTTPS.