fix import orders
This commit is contained in:
@@ -2,9 +2,10 @@ package responsemodifers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"ladder/proxychain"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"ladder/proxychain"
|
||||
)
|
||||
|
||||
var forwardBlacklist map[string]bool
|
||||
@@ -23,7 +24,6 @@ func init() {
|
||||
// ForwardResponseHeaders forwards the response headers from the upstream server to the client
|
||||
func ForwardResponseHeaders() proxychain.ResponseModification {
|
||||
return func(chain *proxychain.ProxyChain) error {
|
||||
|
||||
//fmt.Println(chain.Response.Header)
|
||||
for uname, headers := range chain.Response.Header {
|
||||
name := strings.ToLower(uname)
|
||||
|
||||
@@ -3,10 +3,12 @@ package responsemodifers
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io"
|
||||
|
||||
//"github.com/go-shiori/dom"
|
||||
"github.com/markusmobius/go-trafilatura"
|
||||
//"golang.org/x/net/html"
|
||||
"io"
|
||||
|
||||
"ladder/proxychain"
|
||||
"ladder/proxychain/responsemodifers/api"
|
||||
)
|
||||
@@ -46,5 +48,4 @@ func APIOutline() proxychain.ResponseModification {
|
||||
chain.Response.Body = io.NopCloser(buf)
|
||||
return nil
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ func (r *HTMLRewriter) Close() error {
|
||||
r.tokenBuffer.Reset()
|
||||
r.currentToken = nil
|
||||
r.currentTokenProcessed = false
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -79,6 +80,7 @@ func (r *HTMLRewriter) Read(p []byte) (int, error) {
|
||||
if r.tokenizer.Err() == io.EOF {
|
||||
return 0, io.EOF
|
||||
}
|
||||
|
||||
return 0, r.tokenizer.Err()
|
||||
}
|
||||
|
||||
@@ -96,6 +98,7 @@ func (r *HTMLRewriter) Read(p []byte) (int, error) {
|
||||
if !rewriter.ShouldModify(r.currentToken) {
|
||||
continue
|
||||
}
|
||||
|
||||
prepend, a := rewriter.ModifyToken(r.currentToken)
|
||||
appends = append(appends, a)
|
||||
// add <prepends> to buffer
|
||||
@@ -125,5 +128,6 @@ func (r *HTMLRewriter) Read(p []byte) (int, error) {
|
||||
r.currentTokenProcessed = true
|
||||
err = nil // EOF in this context is expected and not an actual error
|
||||
}
|
||||
|
||||
return n, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user