Skip to content

Commit

Permalink
Encode request body to handle special characters (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
uditdc authored Oct 25, 2023
1 parent fc044f5 commit c84538e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/commands/function/invoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const run = async (options: any) => {
envVarsKeys.push('BLS_REQUEST_HEADERS')

if (request.body) {
envVars.push(`BLS_REQUEST_BODY="${JSON.stringify(request.body)}"`)
envVars.push(`BLS_REQUEST_BODY="${encodeURIComponent(JSON.stringify(request.body))}"`)
envVarsKeys.push('BLS_REQUEST_BODY')
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/sites/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const run = async (options: any) => {
envVarsKeys.push('BLS_REQUEST_HEADERS')

if (request.body) {
envVars.push(`BLS_REQUEST_BODY="${JSON.stringify(request.body)}"`)
envVars.push(`BLS_REQUEST_BODY="${encodeURIComponent(JSON.stringify(request.body))}"`)
envVarsKeys.push('BLS_REQUEST_BODY')
}

Expand Down

0 comments on commit c84538e

Please sign in to comment.