File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -82,19 +82,21 @@ public struct StreamingLambdaCodableAdapter<
8282 context: LambdaContext
8383 ) async throws {
8484
85- // try to decode the event as a FunctionURLRequest and extract it's body
85+ // try to decode the event as a FunctionURLRequest and extract its body
8686 let urlRequestBody = bodyFromFunctionURLRequest ( event)
8787
88- // otherwise, decode the event as a user-provided JSON event
88+ // decode the body or the event as user-provided JSON
8989 let decodedEvent = try self . decoder. decode ( Handler . Event. self, from: urlRequestBody ?? event)
90+
91+ // and pass it to the handler
9092 try await self . handler. handle ( decodedEvent, responseWriter: responseWriter, context: context)
9193 }
9294
93- /// Extract the body payload from the event.
95+ /// Extract the body payload from a FunctionURLRequest event.
9496 /// This function checks if the event is a valid `FunctionURLRequest` and decodes the body if it is base64 encoded.
9597 /// If the event is not a valid `FunctionURLRequest`, it returns nil.
9698 /// - Parameter event: The raw ByteBuffer event to check.
97- /// - Returns: the base64 decodeded body of the FunctionURLRequest if it is a valid FunctionURLRequest, otherwise nil.
99+ /// - Returns: The base64 decoded body of the FunctionURLRequest if it is a valid FunctionURLRequest, otherwise nil.
98100 @inlinable
99101 package func bodyFromFunctionURLRequest( _ event: ByteBuffer ) -> ByteBuffer ? {
100102 do {
You can’t perform that action at this time.
0 commit comments