mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-06-27 23:48:23 +00:00
Disable media streaming
This commit is contained in:
parent
cb99714a47
commit
65e5711766
2
main.go
2
main.go
@ -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{
|
||||
|
@ -1,9 +1,9 @@
|
||||
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
|
||||
}
|
||||
|
||||
body, err := ioutil.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
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)
|
||||
return c.Send(body)
|
||||
}
|
Loading…
Reference in New Issue
Block a user