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

View File

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

View File

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

View File

@ -35,7 +35,8 @@ func (v *UpstreamConfig) GetType() string {
func (v *UpstreamConfig) GetRawURI() (string, url.Values) {
uri := strings.SplitN(v.URI, "://", 2)[1]
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
}