Switch to using jsoniter

This commit is contained in:
George Shammas
2022-01-05 12:23:33 -05:00
parent 5a94b7a588
commit 0395b2024d
4 changed files with 8 additions and 4 deletions

View File

@@ -1,7 +1,6 @@
package main
import (
"encoding/json"
"fmt"
"net"
"os"
@@ -9,6 +8,8 @@ import (
"strings"
"time"
json "github.com/json-iterator/go"
"github.com/gin-gonic/gin"
proxyproto "github.com/pires/go-proxyproto"
)
@@ -153,7 +154,8 @@ func mainHandler(c *gin.Context) {
response, _ := json.Marshal(c.Keys)
c.String(200, "ifconfig_io = %v\n", string(response))
} else {
c.String(200, "%v", c.Keys)
c.Writer.Header().Set("Content-Type", "text/plain; charset=utf-8")
c.YAML(200, c.Keys)
}
return
case "headers":