mirror of
https://github.com/TeamPiped/http3-ytproxy.git
synced 2024-08-14 23:56:43 +00:00
set query
This commit is contained in:
parent
7a25370548
commit
3824106118
1 changed files with 7 additions and 1 deletions
8
main.go
8
main.go
|
@ -125,13 +125,19 @@ func (*requesthandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
log.Panic(err)
|
log.Panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyURL.RawQuery = q.Encode()
|
proxyURL.RawQuery = ""
|
||||||
|
for k, v := range q {
|
||||||
|
for _, vv := range v {
|
||||||
|
proxyURL.Query().Set(k, vv)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if strings.HasSuffix(proxyURL.EscapedPath(), "maxres.jpg") {
|
if strings.HasSuffix(proxyURL.EscapedPath(), "maxres.jpg") {
|
||||||
proxyURL.Path = getBestThumbnail(proxyURL.EscapedPath())
|
proxyURL.Path = getBestThumbnail(proxyURL.EscapedPath())
|
||||||
}
|
}
|
||||||
|
|
||||||
request, err := http.NewRequest(req.Method, proxyURL.String(), nil)
|
request, err := http.NewRequest(req.Method, proxyURL.String(), nil)
|
||||||
|
fmt.Println(proxyURL.Query().Encode())
|
||||||
fmt.Println(proxyURL.String())
|
fmt.Println(proxyURL.String())
|
||||||
copyHeaders(req.Header, request.Header)
|
copyHeaders(req.Header, request.Header)
|
||||||
request.Header.Set("User-Agent", ua)
|
request.Header.Set("User-Agent", ua)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue