mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2025-12-10 05:39:38 +05:00
small fixes
This commit is contained in:
@@ -93,7 +93,7 @@ type Export struct {
|
||||
Preferences *cfg.Preferences `json:",omitempty"`
|
||||
}
|
||||
|
||||
func Load(r fiber.Router) {
|
||||
func Load(r *fiber.App) {
|
||||
r.Get("/_/preferences", func(c fiber.Ctx) error {
|
||||
p, err := Get(c)
|
||||
if err != nil {
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
var httpc *fasthttp.HostClient
|
||||
var al_httpc *fasthttp.HostClient
|
||||
|
||||
func Load(r fiber.Router) {
|
||||
func Load(r *fiber.App) {
|
||||
httpc = &fasthttp.HostClient{
|
||||
Addr: cfg.ImageCDN + ":443",
|
||||
IsTLS: true,
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
var httpc *fasthttp.HostClient
|
||||
var httpc_aac *fasthttp.HostClient
|
||||
|
||||
func Load(r fiber.Router) {
|
||||
func Load(r *fiber.App) {
|
||||
httpc = &fasthttp.HostClient{
|
||||
Addr: cfg.HLSCDN + ":443",
|
||||
IsTLS: true,
|
||||
|
||||
@@ -194,7 +194,7 @@ func (c *collector) Write(data []byte) (n int, err error) {
|
||||
return len(data), nil
|
||||
}
|
||||
|
||||
func Load(r fiber.Router) {
|
||||
func Load(r *fiber.App) {
|
||||
httpc = &fasthttp.HostClient{
|
||||
Addr: cfg.HLSCDN + ":443",
|
||||
IsTLS: true,
|
||||
|
||||
12
main.go
12
main.go
@@ -66,7 +66,7 @@ func (staticfs) Open(name string) (fs.File, error) {
|
||||
// stubby implementation of static middleware
|
||||
// why? mainly because of the pathrewrite
|
||||
// i hate seeing it trying to get root directory
|
||||
func ServeFromFS(r fiber.Router, filesystem fs.FS) {
|
||||
func ServeFromFS(r *fiber.App, filesystem fs.FS) {
|
||||
const path = "/_/static"
|
||||
const l = len(path)
|
||||
fs := fasthttp.FS{
|
||||
@@ -161,12 +161,10 @@ func main() {
|
||||
|
||||
// why? because when you load a page without link rel="icon" the browser will
|
||||
// try to load favicon from default location,
|
||||
// and this path loads the user "favicon.ico" by default
|
||||
if cfg.Debug {
|
||||
app.Get("favicon.ico", func(c fiber.Ctx) error {
|
||||
return c.Redirect().To("/_/static/favicon.ico")
|
||||
})
|
||||
}
|
||||
// and this path loads the user "favicon" by default
|
||||
app.Get("favicon.ico", func(c fiber.Ctx) error {
|
||||
return c.Redirect().To("/_/static/favicon.ico")
|
||||
})
|
||||
|
||||
app.Get("/search", func(c fiber.Ctx) error {
|
||||
prefs, err := preferences.Get(c)
|
||||
|
||||
Reference in New Issue
Block a user