17 行
363 B
Go
17 行
363 B
Go
|
package utils
|
||
|
|
||
|
import (
|
||
|
"github.com/gofiber/fiber/v2"
|
||
|
"github.com/gofiber/fiber/v2/middleware/proxy"
|
||
|
)
|
||
|
|
||
|
// ProxyRequest proxies requests to GitHub media
|
||
|
func ProxyRequest(c *fiber.Ctx, url string) error {
|
||
|
if err := proxy.Do(c, url); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
// Remove Server header from response
|
||
|
c.Response().Header.Del(fiber.HeaderServer)
|
||
|
return nil
|
||
|
}
|