Skip to content

Commit 0be73a4

Browse files
corvid-agentclaude
andcommitted
refactor: use Object.fromEntries for headers conversion
Address review feedback: simplify headers extraction by using Object.fromEntries() instead of manual forEach loop. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fb2b5fa commit 0be73a4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/client/transports/rest_transport.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,10 @@ export class RestTransport implements Transport {
340340
}
341341

342342
private static extractHttpDetails(response: Response): A2AErrorHttpDetails {
343-
const headers: Record<string, string> = {};
344-
response.headers.forEach((value, key) => {
345-
headers[key] = value;
346-
});
347-
return { statusCode: response.status, headers };
343+
return {
344+
statusCode: response.status,
345+
headers: Object.fromEntries(response.headers),
346+
};
348347
}
349348

350349
private static mapToError(error: RestErrorResponse, httpDetails?: A2AErrorHttpDetails): Error {

0 commit comments

Comments
 (0)