🐛 Bug fixes
All checks were successful
release-nightly / build-docker (push) Successful in 1m19s

This commit is contained in:
LittleSheep 2023-12-16 22:57:32 +08:00
parent 4942a8b7a2
commit 0ffd582d80
4 changed files with 10 additions and 6 deletions

View File

@ -2,6 +2,7 @@ package deploy
import ( import (
"fmt" "fmt"
jsoniter "github.com/json-iterator/go"
"io" "io"
"os" "os"
"strings" "strings"
@ -81,6 +82,8 @@ var DeployCommands = []*cli.Command{
url := fmt.Sprintf("/webhooks/sync/%s", ctx.Args().Get(1)) url := fmt.Sprintf("/webhooks/sync/%s", ctx.Args().Get(1))
client := fiber.Put(server.Url+url). client := fiber.Put(server.Url+url).
JSONEncoder(jsoniter.ConfigCompatibleWithStandardLibrary.Marshal).
JSONDecoder(jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal).
JSON(site). JSON(site).
BasicAuth("RoadSign CLI", server.Credential) BasicAuth("RoadSign CLI", server.Credential)

View File

@ -8,7 +8,7 @@ import (
var CompressResponse = RequestTransformer{ var CompressResponse = RequestTransformer{
ModifyResponse: func(options any, ctx *fiber.Ctx) error { ModifyResponse: func(options any, ctx *fiber.Ctx) error {
opts := DeserializeOptions[struct { opts := DeserializeOptions[struct {
Level int `json:"level"` Level int `json:"level" yaml:"level"`
}](options) }](options)
var fctx = func(c *fasthttp.RequestCtx) {} var fctx = func(c *fasthttp.RequestCtx) {}

View File

@ -9,10 +9,10 @@ import (
var ReplacePath = RequestTransformer{ var ReplacePath = RequestTransformer{
ModifyRequest: func(options any, ctx *fiber.Ctx) error { ModifyRequest: func(options any, ctx *fiber.Ctx) error {
opts := DeserializeOptions[struct { opts := DeserializeOptions[struct {
Pattern string `json:"pattern"` Pattern string `json:"pattern" yaml:"pattern"`
Value string `json:"value"` Value string `json:"value" yaml:"value"`
Repl string `json:"repl"` // Use when complex mode(regexp) enabled Repl string `json:"repl" yaml:"repl"` // Use when complex mode(regexp) enabled
Complex bool `json:"complex"` Complex bool `json:"complex" yaml:"complex"`
}](options) }](options)
path := string(ctx.Request().URI().Path()) path := string(ctx.Request().URI().Path())
if !opts.Complex { if !opts.Complex {

View File

@ -35,7 +35,8 @@ func (v *UpstreamConfig) GetType() string {
func (v *UpstreamConfig) GetRawURI() (string, url.Values) { func (v *UpstreamConfig) GetRawURI() (string, url.Values) {
uri := strings.SplitN(v.URI, "://", 2)[1] uri := strings.SplitN(v.URI, "://", 2)[1]
data := strings.SplitN(uri, "?", 2) data := strings.SplitN(uri, "?", 2)
qs, _ := url.ParseQuery(data[1]) data = append(data, " ") // Make data array least have two element
qs, _ := url.ParseQuery(data[0])
return data[0], qs return data[0], qs
} }