Add minimal logging

master
eater 5 years ago
parent 87cb056ce3
commit 5d94a64efe
Signed by: eater
GPG Key ID: 656785D50BE51C0A

@ -8,7 +8,9 @@ import (
"encoding/json"
"errors"
"io/ioutil"
"log"
"net/http"
"strings"
)
import "golang.org/x/crypto/blowfish"
@ -56,11 +58,13 @@ func NewHttpServer(manager *Manager) *httpServer {
func (it *httpServer) Start() {
http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
log.Printf("%s /", strings.ToUpper(request.Method))
writer.WriteHeader(200)
writer.Write([]byte("Don't"))
})
http.HandleFunc("/create-csr", func(writer http.ResponseWriter, request *http.Request) {
log.Printf("%s /create-csr", strings.ToUpper(request.Method))
req := &CreateCSRRequest{}
err := it.verifyRequest(request, req)
@ -81,6 +85,7 @@ func (it *httpServer) Start() {
})
http.HandleFunc("/deliver-crt", func(writer http.ResponseWriter, request *http.Request) {
log.Printf("%s /deliver-crt", strings.ToUpper(request.Method))
req := &DeliverCertificateRequest{}
err := it.verifyRequest(request, req)
if err != nil {
@ -98,6 +103,7 @@ func (it *httpServer) Start() {
})
http.HandleFunc("/update-openvpn-config", func(writer http.ResponseWriter, request *http.Request) {
log.Printf("%s /update-openvpn-config", strings.ToUpper(request.Method))
req := &UpdateOpenVPNConfigRequest{}
err := it.verifyRequest(request, req)
if err != nil {

Loading…
Cancel
Save