Add TLS support

Fixes #20.

Change-Id: I9c6b4ff3195f05e8a3c17d6704ee06b1f77db562
This commit is contained in:
sm
2016-04-27 21:30:18 -07:00
parent 680eecb111
commit cce3166bdd
2 changed files with 20 additions and 4 deletions
+5 -1
View File
@@ -130,7 +130,11 @@ func (s *Server) register(w http.ResponseWriter, req *http.Request) {
http.Error(w, err.Message, err.Code)
return
}
log.Printf("http://%s/api/v0/confirm/%+v", req.Host, tok)
proto := "https"
if req.TLS == nil {
proto = "http"
}
log.Printf("%s://%s/api/v0/confirm/%+v", proto, req.Host, tok)
fmt.Fprintf(w, "please check your email\n")
}