]> Sergey Matveev's repositories - tofuproxy.git/commitdiff
I stopped using Xombrero
authorSergey Matveev <stargrave@stargrave.org>
Tue, 2 May 2023 11:03:07 +0000 (14:03 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 2 May 2023 11:03:19 +0000 (14:03 +0300)
doc/index.texi
rounds/noHead.go [deleted file]
rounds/transcodeWebP.go
trip.go

index 4df3b7e8aeb868b7c2f40ca5dee3d6c17b63ac80..b6704a6fe981f68487e7433539c540317540af16 100644 (file)
@@ -83,9 +83,6 @@ And additional personal preferences:
 @item
 Various spying domains (advertisement, tracking counters) are denied.
 
-@item
-@code{HEAD} method is forbidden. Xombrero likes it too much.
-
 @item
 @code{www.reddit.com} is redirected to @code{old.reddit.com} (because it
 works without JavaScript and looks nicer).
diff --git a/rounds/noHead.go b/rounds/noHead.go
deleted file mode 100644 (file)
index ce0d103..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-tofuproxy -- flexible HTTP/HTTPS proxy, TLS terminator, X.509 TOFU
-             manager, WARC/geminispace browser
-Copyright (C) 2021-2023 Sergey Matveev <stargrave@stargrave.org>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 3 of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package rounds
-
-import (
-       "net/http"
-)
-
-func RoundNoHead(
-       host string,
-       resp *http.Response,
-       w http.ResponseWriter,
-       req *http.Request,
-) (bool, error) {
-       if req.Method == http.MethodHead {
-               http.Error(w, "deny HEAD", http.StatusMethodNotAllowed)
-               return false, nil
-       }
-       return true, nil
-}
index 016c6178b0ea9b074b6f8b001ca99c2b8d4002ab..7c4995d46c962dd11bbb1a6ef4c508adcf0e28f2 100644 (file)
@@ -25,24 +25,19 @@ import (
        "net/http"
        "os"
        "os/exec"
-       "strings"
 
        "go.stargrave.org/tofuproxy/fifos"
 )
 
 const CmdDWebP = "dwebp"
 
-func isXombrero(req *http.Request) bool {
-       return strings.Contains(req.Header.Get("User-Agent"), "AppleWebKit/538.15")
-}
-
 func RoundTranscodeWebP(
        host string,
        resp *http.Response,
        w http.ResponseWriter,
        req *http.Request,
 ) (bool, error) {
-       if resp.Header.Get("Content-Type") != "image/webp" || isXombrero(req) {
+       if resp.Header.Get("Content-Type") != "image/webp" {
                return true, nil
        }
        tmpFd, err := os.CreateTemp("", "tofuproxy.*.webp")
diff --git a/trip.go b/trip.go
index 975776b13d8ad2b7a495960ef8500a1d3667c51b..4f3e1d6de56ac6e86bf174abe481caf9227d5ae1 100644 (file)
--- a/trip.go
+++ b/trip.go
@@ -65,7 +65,6 @@ func roundTrip(w http.ResponseWriter, req *http.Request) {
        fifos.LogReq <- fmt.Sprintf("%s %s", req.Method, req.URL)
        host := strings.TrimSuffix(req.URL.Host, ":443")
        for _, round := range []Round{
-               rounds.RoundNoHead,
                rounds.RoundGemini,
                rounds.RoundWARC,
                rounds.RoundDenySpy,