This commit is contained in:
parent
4942a8b7a2
commit
0ffd582d80
@ -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)
|
||||
|
||||
|
@ -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) {}
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user