Skip to content

Commit

Permalink
Move comments around
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Jul 15, 2024
1 parent b8f98ca commit b0176ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/beacon-node/src/api/rest/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ export class RestApiServer {
this.logger.debug(`Req ${req.id} ${req.ip} ${operationId}`);
metrics?.requests.inc({operationId});

const userAgent = req.headers["user-agent"]?.split("/")[0] ?? "";
// Workaround to fix compatibility with go-eth2-client
// See https://github.com/attestantio/go-eth2-client/issues/144
if (
// go-eth2-client supports handling SSZ data in response for these endpoints
["produceBlindedBlock", "produceBlockV3", "getBlockV2", "getStateV2"].includes(operationId) &&
// Only Vouch seems to override default header
["Go-http-client", "Vouch"].includes(userAgent)
["Go-http-client", "Vouch"].includes(req.headers["user-agent"]?.split("/")[0] ?? "")
) {
// Override Accept header to force server to return JSON
// See https://github.com/attestantio/go-eth2-client/issues/144
req.headers.accept = "application/json";
}
});
Expand Down

0 comments on commit b0176ba

Please sign in to comment.