fix: include request body to AWS V4 signer in effective request functions (#5084)
This commit is contained in:
parent
d213bec3ef
commit
130facb440
2 changed files with 7 additions and 0 deletions
|
|
@ -202,8 +202,11 @@ export async function getEffectiveRESTRequest(
|
|||
const amzDate = currentDate.toISOString().replace(/[:-]|\.\d{3}/g, "");
|
||||
const { method, endpoint } = request;
|
||||
|
||||
const body = getFinalBodyFromRequest(request, resolvedVariables);
|
||||
|
||||
const signer = new AwsV4Signer({
|
||||
method,
|
||||
body: E.isRight(body) ? body.right?.toString() : undefined,
|
||||
datetime: amzDate,
|
||||
signQuery: addTo === "QUERY_PARAMS",
|
||||
accessKeyId: parseTemplateString(
|
||||
|
|
|
|||
|
|
@ -222,8 +222,12 @@ export const getComputedAuthHeaders = async (
|
|||
const currentDate = new Date()
|
||||
const amzDate = currentDate.toISOString().replace(/[:-]|\.\d{3}/g, "")
|
||||
const { method, endpoint } = req as HoppRESTRequest
|
||||
|
||||
const body = getFinalBodyFromRequest(request, envVars)
|
||||
|
||||
const signer = new AwsV4Signer({
|
||||
method: method,
|
||||
body: body?.toString(),
|
||||
datetime: amzDate,
|
||||
accessKeyId: parseTemplateString(request.auth.accessKey, envVars),
|
||||
secretAccessKey: parseTemplateString(request.auth.secretKey, envVars),
|
||||
|
|
|
|||
Loading…
Reference in a new issue