Skip to main content

parseGerritJsonResponse()

Home > @backstage/integration > parseGerritJsonResponse

Parse the json response from Gerrit and strip the magic prefix.

Signature:

function parseGerritJsonResponse(response: Response): Promise<unknown>;

Parameters

ParameterTypeDescription
responseResponseAn API response.

Returns:

Promise<unknown>

Remarks

To prevent against XSSI attacks the JSON response body from Gerrit starts with a magic prefix that must be stripped before it can be fed to a JSON parser.