From cf30b6564835ab43ee007fa3d4b48a53f47c1e05 Mon Sep 17 00:00:00 2001 From: CarbonNeuron <16768821+CarbonNeuron@users.noreply.github.com> Date: Wed, 3 Feb 2021 08:41:27 -0600 Subject: [PATCH] Add Content-Type header to stats endpoint This fixes #7 --- broker/broker.go | 1 + 1 file changed, 1 insertion(+) diff --git a/broker/broker.go b/broker/broker.go index 50b8c30..372d6ac 100644 --- a/broker/broker.go +++ b/broker/broker.go @@ -237,6 +237,7 @@ func (broker *Broker) Start(port string) { w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Methods", "GET, OPTIONS") w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length") + w.Header().Set("Content-Type", "application/json") //Set content type to Application/Json because we are serving json data broker.connectionsLock.RLock() activeConns := len(broker.connections)