We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 787a3c2 commit 1650763Copy full SHA for 1650763
lambdaurl/http_handler_test.go
@@ -142,3 +142,16 @@ func TestWrap(t *testing.T) {
142
})
143
}
144
145
+
146
+func TestRequestContext(t *testing.T) {
147
+ var req *events.LambdaFunctionURLRequest
148
+ require.NoError(t, json.Unmarshal(helloRequest, &req))
149
+ handler := Wrap(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
150
+ reqFromContext, exists := RequestFromContext(r.Context())
151
+ require.True(t, exists)
152
+ require.NotNil(t, reqFromContext)
153
+ assert.Equal(t, req, reqFromContext)
154
+ }))
155
+ _, err := handler(context.Background(), req)
156
+ require.NoError(t, err)
157
+}
0 commit comments