gitlin/utils/proxyrequest.go

17 行
363 B
Go
Raw 通常表示 履歴

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
}