Skip to content

Commit

Permalink
Only write status ok on success
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Dec 27, 2024
1 parent 0d8daa4 commit 802b809
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions internal/server/openvpn.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,5 @@ func (h *openvpnHandler) setPortForwarded(w http.ResponseWriter, r *http.Request
return
}

encoder := json.NewEncoder(w)
err = encoder.Encode(h.pf.GetPortsForwarded())
if err != nil {
h.warner.Warn(err.Error())
w.WriteHeader(http.StatusInternalServerError)
}
w.WriteHeader(http.StatusOK)
}

0 comments on commit 802b809

Please sign in to comment.