Skip to content

Commit

Permalink
[Fix] 🐛 th.bing.com Proxy Error
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-zklcdc committed May 10, 2024
1 parent 250f571 commit 88b0a1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/th.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ func Th(w http.ResponseWriter, r *http.Request) {
helper.UnauthorizedResult(w)
return
}
r.URL.Path = strings.ReplaceAll(r.URL.Path, "/th/", "/")
r.URL.Path = strings.ReplaceAll(r.URL.Path, "/th/th", "/th")
common.NewSingleHostReverseProxy(common.BING_SOURCE_URL).ServeHTTP(w, r)
}
2 changes: 1 addition & 1 deletion cloudflare/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export default {
if (currentUrl.pathname.startsWith('/sydney')) {
targetUrl = new URL(SYDNEY_ORIGIN + currentUrl.pathname + currentUrl.search);
} else if (currentUrl.pathname.startsWith('/th')) {
targetUrl = new URL(BING_SOURCE_ORIGIN + currentUrl.pathname.replaceAll('/th/', '/') + currentUrl.search);
targetUrl = new URL(BING_SOURCE_ORIGIN + currentUrl.pathname.replaceAll('/th/th', '/th') + currentUrl.search);
} else if (currentUrl.pathname.startsWith('/edgesvc')) {
targetUrl = new URL(EDGE_ORIGIN + currentUrl.pathname + currentUrl.search);
} else if (currentUrl.pathname.startsWith('/opaluqu')) {
Expand Down

0 comments on commit 88b0a1b

Please sign in to comment.