Replace json encoder and decoder
All checks were successful
release-nightly / build-docker (push) Successful in 1m1s

This commit is contained in:
2023-12-16 12:35:42 +08:00
parent 79e060da5d
commit cea4114019
4 changed files with 17 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package sideload
import (
"fmt"
jsoniter "github.com/json-iterator/go"
roadsign "code.smartsheep.studio/goatworks/roadsign/pkg"
"github.com/gofiber/fiber/v2"
@ -17,6 +18,8 @@ func InitSideload() *fiber.App {
ServerHeader: "RoadSign Sideload",
DisableStartupMessage: true,
EnableIPValidation: true,
JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal,
JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal,
EnablePrintRoutes: viper.GetBool("debug.print_routes"),
TrustedProxies: viper.GetStringSlice("security.sideload_trusted_proxies"),
BodyLimit: viper.GetInt("hypertext.limitation.max_body_size"),