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,
|
Views: engine,
|
||||||
Prefork: viper.GetBool("FIBER_PREFORK"),
|
Prefork: viper.GetBool("FIBER_PREFORK"),
|
||||||
UnescapePath: true,
|
UnescapePath: true,
|
||||||
StreamRequestBody: true,
|
StreamRequestBody: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
app.Use("/static", filesystem.New(filesystem.Config{
|
app.Use("/static", filesystem.New(filesystem.Config{
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package pages
|
package pages
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"codeberg.org/video-prize-ranch/rimgo/utils"
|
"codeberg.org/video-prize-ranch/rimgo/utils"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
)
|
)
|
||||||
@ -32,7 +32,11 @@ func handleMedia(c *fiber.Ctx, url string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body, err := ioutil.ReadAll(res.Body)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
c.Set("Content-Type", res.Header.Get("Content-Type"));
|
c.Set("Content-Type", res.Header.Get("Content-Type"));
|
||||||
contentLen, _ := strconv.Atoi(res.Header.Get("Content-Length"))
|
return c.Send(body)
|
||||||
return c.SendStream(res.Body, contentLen)
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user