API and many small fixes

This commit is contained in:
Laptop
2025-06-20 21:52:25 +03:00
parent a0551d742b
commit 5e96cee22e
10 changed files with 161 additions and 62 deletions

View File

@@ -42,7 +42,6 @@ func Load(a *fiber.App) {
req.SetURI(parsed)
req.Header.SetUserAgent(cfg.UserAgent)
req.Header.Set("Accept-Encoding", "gzip, deflate, br, zstd")
resp := fasthttp.AcquireResponse()
//defer fasthttp.ReleaseResponse(resp)
@@ -81,7 +80,6 @@ func Load(a *fiber.App) {
req.SetURI(parsed)
req.Header.SetUserAgent(cfg.UserAgent)
req.Header.Set("Accept-Encoding", "gzip, deflate, br, zstd")
resp := fasthttp.AcquireResponse()
@@ -119,7 +117,6 @@ func Load(a *fiber.App) {
req.SetURI(parsed)
req.Header.SetUserAgent(cfg.UserAgent)
req.Header.Set("Accept-Encoding", "gzip, deflate, br, zstd")
resp := fasthttp.AcquireResponse()
defer fasthttp.ReleaseResponse(resp)
@@ -170,7 +167,6 @@ func Load(a *fiber.App) {
req.SetURI(parsed)
req.Header.SetUserAgent(cfg.UserAgent)
req.Header.Set("Accept-Encoding", "gzip, deflate, br, zstd")
resp := fasthttp.AcquireResponse()
defer fasthttp.ReleaseResponse(resp)
@@ -180,12 +176,7 @@ func Load(a *fiber.App) {
return err
}
data, err := resp.BodyUncompressed()
if err != nil {
data = resp.Body()
}
var sp = bytes.Split(data, newline)
var sp = bytes.Split(resp.Body(), newline)
for i, l := range sp {
if len(l) == 0 {
continue