Skip to content

Commit 232af9c

Browse files
committed
encode query params
1 parent ea1de01 commit 232af9c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

veracode-api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ async function veracodeApiRequest(apiKeyId, apiKeySecret, method, url, queryPara
7979
const queryStringForSignature = Object.keys(queryParams)
8080
.filter(key => queryParams[key] !== undefined && queryParams[key] !== null)
8181
// .sort() // Sort alphabetically for signature
82-
.map(key => `${key}=${queryParams[key]}`)
82+
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(queryParams[key])}`)
8383
.join('&');
8484

8585
// Format query string for signature: add ? prefix if params exist
86-
const encodeURIComponent(urlQueryParams) = queryStringForSignature ? `?${queryStringForSignature}` : '';
86+
const urlQueryParams = queryStringForSignature ? `?${queryStringForSignature}` : '';
8787

8888
// Generate authorization header using the same method as uploadandscan-action
8989
if ( debug == "true" ){

0 commit comments

Comments
 (0)