From 390ff81c8efb9a2db6d3ff22092260c002cebf1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Sun, 10 Sep 2023 23:51:16 +0800 Subject: [PATCH] Fixed prefix with slash generates wrong sig --- arch_delete_aws4.sh | 2 +- arch_delete_many_aws4.sh | 2 +- arch_download_aws4.sh | 2 +- arch_getacl_aws4.sh | 2 +- arch_list_aws4.sh | 2 +- arch_upload_aws4.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch_delete_aws4.sh b/arch_delete_aws4.sh index 6e42aba..689eb01 100755 --- a/arch_delete_aws4.sh +++ b/arch_delete_aws4.sh @@ -29,7 +29,7 @@ if [ -z "$ARCH_S3_BUCKET_URL" ]; then fi function _str { printf "%s" $@; } -function _stre { printf $@; } +function _stre { printf $( echo -n "$@" | sed "s/%/%%/g" ); } BUCKET_NAME=$( _str $ARCH_S3_BUCKET_URL | cut -d'.' -f1 ) SERVICE=$( _str $ARCH_S3_BUCKET_URL | cut -d'.' -f2 ) diff --git a/arch_delete_many_aws4.sh b/arch_delete_many_aws4.sh index 328b191..8cd11c9 100755 --- a/arch_delete_many_aws4.sh +++ b/arch_delete_many_aws4.sh @@ -30,7 +30,7 @@ if [ -z "$ARCH_S3_BUCKET_URL" ]; then fi function _str { printf "%s" $@; } -function _stre { printf $@; } +function _stre { printf $( echo -n "$@" | sed "s/%/%%/g" ); } _TEMP=$( mktemp ) function __clean_up { rm $_TEMP; } diff --git a/arch_download_aws4.sh b/arch_download_aws4.sh index 760d582..d5d75d7 100755 --- a/arch_download_aws4.sh +++ b/arch_download_aws4.sh @@ -28,7 +28,7 @@ if [ -z "$ARCH_S3_BUCKET_URL" ]; then fi function _str { printf "%s" $@; } -function _stre { printf $@; } +function _stre { printf $( echo -n "$@" | sed "s/%/%%/g" ); } BUCKET_NAME=$( _str $ARCH_S3_BUCKET_URL | cut -d'.' -f1 ) SERVICE=$( _str $ARCH_S3_BUCKET_URL | cut -d'.' -f2 ) diff --git a/arch_getacl_aws4.sh b/arch_getacl_aws4.sh index 50f966b..3993356 100755 --- a/arch_getacl_aws4.sh +++ b/arch_getacl_aws4.sh @@ -28,7 +28,7 @@ if [ -z "$ARCH_S3_BUCKET_URL" ]; then fi function _str { printf "%s" $@; } -function _stre { printf $@; } +function _stre { printf $( echo -n "$@" | sed "s/%/%%/g" ); } BUCKET_NAME=$( _str $ARCH_S3_BUCKET_URL | cut -d'.' -f1 ) SERVICE=$( _str $ARCH_S3_BUCKET_URL | cut -d'.' -f2 ) diff --git a/arch_list_aws4.sh b/arch_list_aws4.sh index 1320bf2..3169cd0 100755 --- a/arch_list_aws4.sh +++ b/arch_list_aws4.sh @@ -25,7 +25,7 @@ if [ -z "$ARCH_S3_BUCKET_URL" ]; then fi function _str { printf "%s" $@; } -function _stre { printf $@; } +function _stre { printf $( echo -n "$@" | sed "s/%/%%/g" ); } BUCKET_NAME=$( _str $ARCH_S3_BUCKET_URL | cut -d'.' -f1 ) SERVICE=$( _str $ARCH_S3_BUCKET_URL | cut -d'.' -f2 ) diff --git a/arch_upload_aws4.sh b/arch_upload_aws4.sh index ed6b9b5..f7acecb 100755 --- a/arch_upload_aws4.sh +++ b/arch_upload_aws4.sh @@ -37,7 +37,7 @@ if [ -z "$ARCH_S3_BUCKET_URL" ]; then fi function _str { printf "%s" $@; } -function _stre { printf $@; } +function _stre { printf $( echo -n "$@" | sed "s/%/%%/g" ); } BUCKET_NAME=$( _str $ARCH_S3_BUCKET_URL | cut -d'.' -f1 ) SERVICE=$( _str $ARCH_S3_BUCKET_URL | cut -d'.' -f2 )