@@ -23,10 +23,10 @@ import {handleDialog} from './tools/pages.js';
2323import type { ImageContentData , Response } from './tools/ToolDefinition.js' ;
2424import { paginate , type PaginationOptions } from './utils/pagination.js' ;
2525
26- export interface NetworkRequestData {
26+ interface NetworkRequestData {
2727 networkRequestUrl : string ;
28- requestBody : string | null ;
29- responseBody : string | null ;
28+ requestBody ? : string ;
29+ responseBody ? : string ;
3030}
3131
3232export class McpResponse implements Response {
@@ -84,8 +84,6 @@ export class McpResponse implements Response {
8484 attachNetworkRequest ( url : string ) : void {
8585 this . #attachedNetworkRequestData = {
8686 networkRequestUrl : url ,
87- responseBody : null ,
88- requestBody : null ,
8987 } ;
9088 }
9189
@@ -170,22 +168,24 @@ export class McpResponse implements Response {
170168
171169 async processResponseBody (
172170 httpResponse : HTTPResponse ,
173- ) : Promise < string | null > {
171+ ) : Promise < string | undefined > {
174172 const formattedResponseData = await getFormattedResponseBody ( httpResponse ) ;
175173 if ( formattedResponseData . length > 0 ) {
176174 return formattedResponseData ;
177175 }
178176
179- return null ;
177+ return undefined ;
180178 }
181179
182- async processRequestBody ( httpRequest : HTTPRequest ) : Promise < string | null > {
180+ async processRequestBody (
181+ httpRequest : HTTPRequest ,
182+ ) : Promise < string | undefined > {
183183 const formattedRequestData = await getFormattedRequestBody ( httpRequest ) ;
184184 if ( formattedRequestData . length > 0 ) {
185185 return formattedRequestData ;
186186 }
187187
188- return null ;
188+ return undefined ;
189189 }
190190
191191 format (
0 commit comments