1
0
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:
Vic Shóstak 2020-02-01 22:38:22 +03:00
parent 6d3e0b9c10
commit 939d63f4f6
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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)
}