Skip to content

Commit

Permalink
Use prefix to check invalid Path
Browse files Browse the repository at this point in the history
  • Loading branch information
n0vad3v committed Apr 23, 2024
1 parent a62f3f2 commit f4f241b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handler/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Convert(c *fiber.Ctx) error {
// 3. pass it to encoder, get the result, send it back

// normal http request will start with /
if strings.HasPrefix(c.Path(), ".") || strings.HasPrefix(c.Path(), "%2e") {
if !strings.HasPrefix(c.Path(), "/") {
_ = c.SendStatus(http.StatusBadRequest)
return nil
}
Expand Down

0 comments on commit f4f241b

Please sign in to comment.