File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,11 @@ private static HttpRequestContext ToHttpRequestContext (this RpcHttp rpcHttp)
58
58
59
59
if ( rpcHttp . RawBody != null )
60
60
{
61
- httpRequestContext . RawBody = rpcHttp . RawBody . ToObject ( ) ;
61
+ object rawBody = rpcHttp . RawBody . DataCase == TypedData . DataOneofCase . String
62
+ ? rpcHttp . RawBody . String
63
+ : rpcHttp . RawBody . ToObject ( ) ;
64
+
65
+ httpRequestContext . RawBody = rawBody ;
62
66
}
63
67
64
68
return httpRequestContext ;
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ public void TestTypedDataToObjectHttpRequestContextBodyData()
90
90
var method = "Get" ;
91
91
var url = "https://example.com" ;
92
92
var data = "Hello World" ;
93
+ var rawData = "{\" Foo\" :\" Bar\" }" ;
93
94
94
95
var input = new TypedData
95
96
{
@@ -103,7 +104,7 @@ public void TestTypedDataToObjectHttpRequestContextBodyData()
103
104
} ,
104
105
RawBody = new TypedData
105
106
{
106
- String = data
107
+ String = rawData
107
108
}
108
109
}
109
110
} ;
@@ -121,7 +122,7 @@ public void TestTypedDataToObjectHttpRequestContextBodyData()
121
122
Assert . Equal ( httpRequestContext . Method , method ) ;
122
123
Assert . Equal ( httpRequestContext . Url , url ) ;
123
124
Assert . Equal ( httpRequestContext . Body , data ) ;
124
- Assert . Equal ( httpRequestContext . RawBody , data ) ;
125
+ Assert . Equal ( httpRequestContext . RawBody , rawData ) ;
125
126
Assert . Empty ( httpRequestContext . Headers ) ;
126
127
Assert . Empty ( httpRequestContext . Params ) ;
127
128
Assert . Empty ( httpRequestContext . Query ) ;
You can’t perform that action at this time.
0 commit comments