mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-22 22:43:54 +00:00
Fix two gosec issues
This commit is contained in:
parent
6d3e0b9c10
commit
939d63f4f6
@ -9,6 +9,7 @@ package fiber
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"log"
|
||||
"mime"
|
||||
"mime/multipart"
|
||||
"strings"
|
||||
@ -338,7 +339,9 @@ func (ctx *Ctx) Route() *Route {
|
||||
|
||||
// SaveFile : https://gofiber.github.io/fiber/#/context?id=secure
|
||||
func (ctx *Ctx) SaveFile(fh *multipart.FileHeader, path string) {
|
||||
fasthttp.SaveMultipartFile(fh, path)
|
||||
if err := fasthttp.SaveMultipartFile(fh, path); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Secure : https://gofiber.github.io/fiber/#/context?id=secure
|
||||
|
@ -10,6 +10,7 @@ package fiber
|
||||
import (
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"log"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
@ -141,7 +142,9 @@ func (ctx *Ctx) Format(args ...interface{}) {
|
||||
case "html":
|
||||
ctx.SendString("<p>" + body + "</p>")
|
||||
case "json":
|
||||
ctx.JSON(body)
|
||||
if err := ctx.JSON(body); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
default:
|
||||
ctx.SendString(body)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user