dcsunny преди 4 години
родител
ревизия
de9c32af76
променени са 2 файла, в които са добавени 0 реда и са изтрити 14 реда
  1. 0 6
      http/middleware/rpc_value.go
  2. 0 8
      http/param/base.go

+ 0 - 6
http/middleware/rpc_value.go

@@ -3,7 +3,6 @@ package middleware
 import (
 	"context"
 	"encoding/json"
-	"fmt"
 	"net/url"
 	"strconv"
 
@@ -52,11 +51,6 @@ func GrpcValue(handler middleware.Handler) middleware.Handler {
 			if len(referer) > 0 {
 				ctx = context2.AppendToContext(ctx, "referer", referer[0])
 			}
-			body := md.Get("body")
-			if len(body) > 0 {
-				fmt.Println(body)
-				ctx = context2.AppendToContext(ctx, "body", body[0])
-			}
 			uri := md.Get("uri")
 			if len(uri) > 0 {
 				ctx = context2.AppendToContext(ctx, "uri", uri[0])

+ 0 - 8
http/param/base.go

@@ -21,14 +21,6 @@ func GetFromPath(c context.Context) string {
 	return ""
 }
 
-func GetBody(c context.Context) string {
-	body := c.Value("body")
-	if _, ok := body.(string); ok {
-		return body.(string)
-	}
-	return ""
-}
-
 func GetUri(c context.Context) string {
 	uri := c.Value("uri")
 	if _, ok := uri.(string); ok {