From 3a1d2bc187eb6544c403c814b9628565a3e9bd16 Mon Sep 17 00:00:00 2001 From: Gianni C Date: Mon, 6 Nov 2023 15:03:26 +0100 Subject: [PATCH 1/2] Remove consider Typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b5d249b..cc7f88d 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Freedom of information is an essential pillar of democracy and informed decision - [ ] Fetch from Google Cache if not available ### Limitations -Certain sites may display missing images or encounter formatting issues. This can be attributed to the site's reliance on JavaScript or CSS for image and resource loading, which presents a limitation when accessed through this proxy. If you prefer a full experience, please concider buying a subscription for the site. +Certain sites may display missing images or encounter formatting issues. This can be attributed to the site's reliance on JavaScript or CSS for image and resource loading, which presents a limitation when accessed through this proxy. If you prefer a full experience, please consider buying a subscription for the site. Some sites do not expose their content to search engines, which means that the proxy cannot access the content. A future version will try to fetch the content from Google Cache. @@ -136,4 +136,4 @@ See in [ruleset.yaml](ruleset.yaml) for an example. - position: .left-content article # Position where to inject the code into DOM prepend: |

Suptitle

-``` \ No newline at end of file +``` From bad7eebd36564567345b76ef76820fabda32ec5d Mon Sep 17 00:00:00 2001 From: Damian Bednarczyk Date: Mon, 6 Nov 2023 15:29:20 -0600 Subject: [PATCH 2/2] fix: preallocate headers array --- handlers/api.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/handlers/api.go b/handlers/api.go index 28e0346..e8a7611 100644 --- a/handlers/api.go +++ b/handlers/api.go @@ -27,7 +27,8 @@ func Api(c *fiber.Ctx) error { Version: version, Body: body, } - response.Request.Headers = make([]interface{}, 0) + + response.Request.Headers = make([]any, 0, len(req.Header)) for k, v := range req.Header { response.Request.Headers = append(response.Request.Headers, map[string]string{ "key": k, @@ -35,7 +36,7 @@ func Api(c *fiber.Ctx) error { }) } - response.Response.Headers = make([]interface{}, 0) + response.Response.Headers = make([]any, 0, len(resp.Header)) for k, v := range resp.Header { response.Response.Headers = append(response.Response.Headers, map[string]string{ "key": k,