Added support for querystring overriding
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
parent
5feb19868f
commit
a6ae1fe7b2
12
main.go
12
main.go
@ -115,6 +115,18 @@ func HandlePayloadPost(c *fiber.Ctx) error {
|
|||||||
fmt.Println("Invalid payload - ", err)
|
fmt.Println("Invalid payload - ", err)
|
||||||
return c.Status(fiber.StatusBadRequest).SendString(err.Error())
|
return c.Status(fiber.StatusBadRequest).SendString(err.Error())
|
||||||
}
|
}
|
||||||
|
fmt.Println("Payload:", payload)
|
||||||
|
|
||||||
|
overrideRoom := c.Query("roomID")
|
||||||
|
if overrideRoom != "" {
|
||||||
|
fmt.Printf("Override room from query string: %s\n", overrideRoom)
|
||||||
|
payload.RoomID = overrideRoom
|
||||||
|
}
|
||||||
|
overrideType := c.Query("type")
|
||||||
|
fmt.Printf("Override type from query string: %s\n", overrideType)
|
||||||
|
if overrideType != "" {
|
||||||
|
payload.Type = PayloadType(overrideType)
|
||||||
|
}
|
||||||
|
|
||||||
switch payload.Type {
|
switch payload.Type {
|
||||||
case PayloadTypeText:
|
case PayloadTypeText:
|
||||||
|
Loading…
Reference in New Issue
Block a user