impl trim

This commit is contained in:
Bel LaPointe
2022-01-11 15:58:27 -05:00
parent ef3abbbf07
commit f28211e722
5 changed files with 7 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"crypto/tls"
"io"
"local/rproxy3/config"
"local/rproxy3/storage/packable"
"log"
"net/http"
@@ -25,6 +26,7 @@ type rewrite struct {
func (s *Server) Proxy(w http.ResponseWriter, r *http.Request) {
newURL, err := s.lookup(mapKey(r.Host))
r.URL.Path = strings.TrimPrefix(r.URL.Path, config.GetTrim())
var transport http.RoundTripper
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
transport = &redirPurge{