2022-01-28 01:41:10 +00:00
|
|
|
package utils
|
|
|
|
|
2023-05-26 19:45:59 +00:00
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
)
|
2022-01-28 01:41:10 +00:00
|
|
|
|
|
|
|
func SetHeaders(c *fiber.Ctx) {
|
|
|
|
c.Set("Referrer-Policy", "no-referrer")
|
|
|
|
c.Set("X-Content-Type-Options", "nosniff")
|
|
|
|
c.Set("X-Robots-Tag", "noindex, noimageindex, nofollow")
|
|
|
|
c.Set("Strict-Transport-Security", "max-age=31557600")
|
2022-02-02 15:20:14 +00:00
|
|
|
c.Set("Permissions-Policy", "accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(self), geolocation=(), gyroscope=(), interest-cohort=(), magnetometer=(), microphone=(), midi=(), navigation-override=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), web-share=(), xr-spatial-tracking=()")
|
2023-05-26 19:45:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func SetReqHeaders(req *http.Request) {
|
|
|
|
req.Header.Set("Accept", "*/*")
|
|
|
|
req.Header.Set("Accept-Language", "en-US,en;q=0.5")
|
|
|
|
req.Header.Set("Cache-Control", "no-cache")
|
|
|
|
req.Header.Set("Connection", "keep-alive")
|
|
|
|
req.Header.Set("Origin", "https://imgur.com")
|
|
|
|
req.Header.Set("Pragma", "no-cache")
|
|
|
|
req.Header.Set("Sec-Fetch-Dest", "empty")
|
|
|
|
req.Header.Set("Sec-Fetch-Mode", "cors")
|
|
|
|
req.Header.Set("Sec-Fetch-Site", "same-site")
|
|
|
|
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0")
|
2022-01-28 01:41:10 +00:00
|
|
|
}
|