File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -148,8 +148,12 @@ export class McpResponse implements Response {
148148
149149 this . #attachedNetworkRequestData. requestBody =
150150 await this . processRequestBody ( request ) ;
151- this . #attachedNetworkRequestData. responseBody =
152- await this . processResponseBody ( request . response ( ) ) ;
151+
152+ const response = request . response ( ) ;
153+ if ( response ) {
154+ this . #attachedNetworkRequestData. responseBody =
155+ await this . processResponseBody ( response ) ;
156+ }
153157 }
154158
155159 if ( this . #includeConsoleData) {
@@ -166,12 +170,8 @@ export class McpResponse implements Response {
166170 }
167171
168172 async processResponseBody (
169- httpResponse : HTTPResponse | null ,
173+ httpResponse : HTTPResponse ,
170174 ) : Promise < string | null > {
171- if ( ! httpResponse ) {
172- return null ;
173- }
174-
175175 const formattedResponseData = await getFormattedResponseBody (
176176 httpResponse ,
177177 BODY_CONTEXT_SIZE_LIMIT ,
@@ -184,10 +184,6 @@ export class McpResponse implements Response {
184184 }
185185
186186 async processRequestBody ( httpRequest : HTTPRequest ) : Promise < string | null > {
187- if ( ! httpRequest ) {
188- return null ;
189- }
190-
191187 const formattedResponseData = await getFormattedRequestBody (
192188 httpRequest ,
193189 BODY_CONTEXT_SIZE_LIMIT ,
You can’t perform that action at this time.
0 commit comments