- Added experimental proxmox fixes
- Fixed upstream error resp code not logging bug
This commit is contained in:
Toby Chui
2024-07-27 17:33:41 +08:00
parent c1e16d55ab
commit ca37bfbfa6
7 changed files with 144 additions and 50 deletions

View File

@@ -61,8 +61,8 @@ func (u *Upstream) Clone() *Upstream {
return &newUpstream
}
// ServeHTTP uses this upstream proxy router to route the current request
func (u *Upstream) ServeHTTP(w http.ResponseWriter, r *http.Request, rrr *dpcore.ResponseRewriteRuleSet) error {
// ServeHTTP uses this upstream proxy router to route the current request, return the status code and error if any
func (u *Upstream) ServeHTTP(w http.ResponseWriter, r *http.Request, rrr *dpcore.ResponseRewriteRuleSet) (int, error) {
//Auto rewrite to upstream origin if not set
if rrr.ProxyDomain == "" {
rrr.ProxyDomain = u.OriginIpOrDomain