summaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'http.go')
-rw-r--r--http.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/http.go b/http.go
index 791392c..003d3b9 100644
--- a/http.go
+++ b/http.go
@@ -17,14 +17,18 @@ func cleanURL(url string) string {
}
// send stuff to the socket and stdout
-func msg(w http.ResponseWriter, s string) {
- log.Info(s)
- fmt.Fprintln(w, s)
+func msg(w http.ResponseWriter, a ...any) {
+ if w == nil {
+ log.Info(a)
+ } else {
+ fmt.Fprintln(w, a)
+ }
}
func okHandler(w http.ResponseWriter, r *http.Request) {
var route string
route = cleanURL(r.URL.Path)
+ log.HttpMode(w)
// common http args that can be set
repoName := r.URL.Query().Get("repo")
@@ -62,7 +66,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
}
case "/doRelease":
buttonDisable()
- if doRelease() {
+ if doRelease(w) {
buttonEnable()
msg(w, "doRelease() worked")
} else {