Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: tools/bug_chomper/src/server/server.go

Issue 649303003: bug_chomper: Consolidate public flag in a single place. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bug_chomper/src/server/server.go
diff --git a/tools/bug_chomper/src/server/server.go b/tools/bug_chomper/src/server/server.go
index fcd1ccc3ef283d94c89e77155343bad5b142cde6..1388d00b9349be37e6032b36d36a2ce736d19d26 100644
--- a/tools/bug_chomper/src/server/server.go
+++ b/tools/bug_chomper/src/server/server.go
@@ -44,7 +44,8 @@ const (
// Flags:
var (
- port = flag.String("port", ":8000", "HTTP service address (e.g., ':8000')")
+ port = flag.String("port", ":8000", "HTTP service address (e.g., ':8000')")
+ public = flag.Bool("public", false, "Make this server publicly accessible.")
)
var (
@@ -358,9 +359,6 @@ func handleRoot(w http.ResponseWriter, r *http.Request) {
// Run the BugChomper server.
func main() {
- var public bool
- flag.BoolVar(
- &public, "public", false, "Make this server publicly accessible.")
flag.Parse()
http.HandleFunc("/", handleRoot)
@@ -368,7 +366,7 @@ func main() {
http.Handle("/res/", http.FileServer(http.Dir(curdir)))
log.Println("Server is running at " + scheme + "://" + localHost + *port)
var err error
- if public {
+ if *public {
log.Println("WARNING: This server is not secure and should not be made " +
"publicly accessible.")
scheme = "https"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698