working commit
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user