proxyrequest.go 372 B

1234567891011121314151617
  1. package utils
  2. import (
  3. "github.com/gofiber/fiber/v2"
  4. "github.com/gofiber/fiber/v2/middleware/proxy"
  5. )
  6. // ProxyRequest proxies requests to GitHub media
  7. func ProxyRequest(c *fiber.Ctx, url string) error {
  8. if err := proxy.Do(c, url); err != nil {
  9. return err
  10. }
  11. // Remove Server header from response
  12. c.Response().Header.Del(fiber.HeaderServer)
  13. return nil
  14. }