mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
25w29a
This commit is contained in:
parent
7e5b12dff8
commit
dd2f5b5a12
7 changed files with 50 additions and 8 deletions
|
|
@ -246,7 +246,7 @@ func extractParts(rawURL string) (string, string, string, url.Values, error) {
|
|||
var urlPattern = regexp.MustCompile(`https?://[^\s'"]+`)
|
||||
|
||||
// processLinks 处理链接,返回包含处理后数据的 io.Reader
|
||||
func processLinks(input io.Reader, compress string, host string, cfg *config.Config) (readerOut io.Reader, written int64, err error) {
|
||||
func processLinks(input io.ReadCloser, compress string, host string, cfg *config.Config) (readerOut io.Reader, written int64, err error) {
|
||||
pipeReader, pipeWriter := io.Pipe() // 创建 io.Pipe
|
||||
readerOut = pipeReader
|
||||
|
||||
|
|
@ -268,6 +268,13 @@ func processLinks(input io.Reader, compress string, host string, cfg *config.Con
|
|||
}
|
||||
}()
|
||||
|
||||
defer func() {
|
||||
if err := input.Close(); err != nil {
|
||||
logError("input close failed: %v", err)
|
||||
}
|
||||
|
||||
}()
|
||||
|
||||
var bufReader *bufio.Reader
|
||||
|
||||
if compress == "gzip" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue