Disable media streaming

This commit is contained in:
video-prize-ranch 2022-01-28 16:40:21 -05:00
parent cb99714a47
commit 65e5711766
No known key found for this signature in database
GPG Key ID: D8EAA4C5B12A7281
2 changed files with 9 additions and 5 deletions

View File

@ -42,7 +42,7 @@ func init() {
Views: engine,
Prefork: viper.GetBool("FIBER_PREFORK"),
UnescapePath: true,
StreamRequestBody: true,
StreamRequestBody: false,
})
app.Use("/static", filesystem.New(filesystem.Config{

View File

@ -1,8 +1,8 @@
package pages
import (
"io/ioutil"
"net/http"
"strconv"
"codeberg.org/video-prize-ranch/rimgo/utils"
"github.com/gofiber/fiber/v2"
@ -32,7 +32,11 @@ func handleMedia(c *fiber.Ctx, url string) error {
return err
}
c.Set("Content-Type", res.Header.Get("Content-Type"));
contentLen, _ := strconv.Atoi(res.Header.Get("Content-Length"))
return c.SendStream(res.Body, contentLen)
body, err := ioutil.ReadAll(res.Body)
if err != nil {
return err
}
c.Set("Content-Type", res.Header.Get("Content-Type"));
return c.Send(body)
}