From 4ff50f961aec291566eaaf6ff89023c6b523b66b Mon Sep 17 00:00:00 2001 From: neri Date: Tue, 4 Feb 2020 22:45:06 +0100 Subject: [PATCH] fix content type --- go.sum | 2 ++ main.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.sum b/go.sum index b93485c..1d4f544 100644 --- a/go.sum +++ b/go.sum @@ -25,7 +25,9 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLD github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/main.go b/main.go index 9cbc3f3..72da507 100644 --- a/main.go +++ b/main.go @@ -64,10 +64,11 @@ func main() { data, err := json.Marshal(aggregator.GetLedStates()) if err != nil { logrus.Error(err) - writer.WriteHeader(503) + writer.WriteHeader(501) return } + writer.Header().Add("Content-Type", "application/json") writer.Write(data) })