aboutsummaryrefslogtreecommitdiff
path: root/server/dht.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/dht.go')
-rw-r--r--server/dht.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/dht.go b/server/dht.go
index 7327676..40bf4e6 100644
--- a/server/dht.go
+++ b/server/dht.go
@@ -234,7 +234,14 @@ func dhtHandler(w http.ResponseWriter, r *http.Request) {
w.Write(val)
} else if r.Method == "POST" {
val, err := io.ReadAll(r.Body)
- if err != nil || dhtPost(key, r.Form.Get("phase"), r.Form.Has("direct"), val) != nil {
+ if err != nil {
+ log.Print(err)
+ w.WriteHeader(http.StatusInternalServerError)
+ return
+ }
+ err = dhtPost(key, r.Form.Get("phase"), r.Form.Has("direct"), val)
+ if err != nil {
+ log.Print(err)
w.WriteHeader(http.StatusInternalServerError)
return
}