gitlin/utils/proxyrequest.go
2023-06-06 20:25:00 +09:00

17 行
372 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
}