mirror of
https://github.com/georgyo/ifconfig.io.git
synced 2025-09-13 15:44:21 +00:00
Switch to using jsoniter
This commit is contained in:
6
main.go
6
main.go
@@ -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":
|
||||
|
Reference in New Issue
Block a user