working commit

This commit is contained in:
2026-05-30 13:37:43 +02:00
parent 89db87e7fa
commit cb69ca11aa
5 changed files with 21 additions and 1 deletions
+7
View File
@@ -7,6 +7,7 @@ import (
"context"
"io"
"net/http"
"strings"
"time"
"mproxy/app/router"
@@ -16,6 +17,12 @@ func (hand *Handler) PlainCall(rctx *router.Context) {
hostaddr := rctx.GetHost()
hand.logg.Debugf("Hostaddr: [%s]", hostaddr)
if !strings.Contains(hostaddr, "http://") {
hand.logg.Errorf("Non-proxy request, not found schema definition in Host")
rctx.SetStatus(http.StatusBadRequest)
return
}
ctx := rctx.GetContext()
ctx, _ = context.WithTimeout(ctx, 5*time.Second)
reqMethod := rctx.Request.Method