Skip to content

Commit 9e8a143

Browse files
committed
fix: line breaks in json payload
1 parent 5d53916 commit 9e8a143

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

benchmark/entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configuration
44
SENDER="bcgov.sso@gov.bc.ca"
55
SUBJECT="Keycloak Benchmark Results - $(date +'%Y-%m-%d %H:%M:%S')"
6-
BODY="Please find the attached benchmark results.\nYou need to base64 decode the attached file (base64 -d -i results.tar.gz) before extracting it.\nRegards,\nBCGov SSO Team"
6+
BODY="Please find the attached benchmark results. You need to base64 decode the attached file before extracting it."
77
RESULTS_DIR="./results"
88
ATTACHMENT_NAME="results.tar.gz"
99

@@ -25,7 +25,7 @@ if [ -d "$RESULTS_DIR" ]; then
2525
# Get the access token
2626
ACCESS_TOKEN=$(curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "client_id=$CHES_CLIENT_ID" -d "client_secret=$CHES_CLIENT_SECRET" -d "grant_type=client_credentials" "$CHES_TOKEN_URL" | jq -r '.access_token')
2727

28-
BASE64_DATA=$(base64 -i $ATTACHMENT_NAME)
28+
BASE64_DATA=$(base64 -w 0 $ATTACHMENT_NAME)
2929

3030
echo '{"from": "'"$SENDER"'", "to": ["'"$RECEPIENT"'"], "subject": "'"$SUBJECT"'", "body": "'"$BODY"'", "bodyType": "text", "attachments": [{"filename": "'"$ATTACHMENT_NAME"'", "content": "'"$BASE64_DATA"'"}]}' | curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ACCESS_TOKEN" --data-binary @- "$MAIL_SERVER"
3131

0 commit comments

Comments
 (0)