This commit is contained in:
@@ -51,13 +51,13 @@ func StartServerProxy() {
|
||||
// Handle all requests with path prefix "/proxy/*"
|
||||
s.BindHandler("/bbs/*url", func(r *ghttp.Request) {
|
||||
var (
|
||||
originalPath = r.Request.URL.Path
|
||||
proxyToPath = "/" + r.Get("url").String()
|
||||
//originalPath = r.Request.URL.Path
|
||||
proxyToPath = "/" + r.Get("url").String()
|
||||
)
|
||||
// Rewrite the request path
|
||||
r.Request.URL.Path = proxyToPath
|
||||
// Log the proxy operation
|
||||
g.Log().Infof(r.Context(), `proxy:"%s" -> backend:"%s"`, originalPath, proxyToPath)
|
||||
//g.Log().Infof(r.Context(), `proxy:"%s" -> backend:"%s"`, originalPath, proxyToPath)
|
||||
// Ensure request body can be read multiple times if needed
|
||||
r.MakeBodyRepeatableRead(false)
|
||||
// Forward the request to the backend server
|
||||
|
||||
Reference in New Issue
Block a user