Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update tests to show asset canister properly handles special chars #4103

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions e2e/tests-dfx/assetscanister.bash
Original file line number Diff line number Diff line change
Expand Up @@ -726,24 +726,24 @@ check_permission_failure() {
}

@test "can serve filenames with special characters in filename" {
# This is observed, not expected behavior
# see https://dfinity.atlassian.net/browse/SDK-1247
install_asset assetscanister

dfx_start

echo "filename is an ae symbol" >'src/e2e_project_frontend/assets/æ'

dfx deploy
ID=$(dfx canister id e2e_project_frontend)
PORT=$(get_webserver_port)

dfx canister call --query e2e_project_frontend list '(record {})'

# decode as expected
# decode as expected - %c3%a6 is the utf-8 encoding of the ae symbol
assert_command dfx canister call --query e2e_project_frontend http_request '(record{url="/%c3%a6";headers=vec{};method="GET";body=vec{}})'
assert_match "filename is an ae symbol" # candid looks like blob "filename is \c3\a6\0a"

ID=$(dfx canister id e2e_project_frontend)
PORT=$(get_webserver_port)
assert_command curl --fail -vv http://localhost:"$PORT"/%c3%a6?canisterId="$ID"
assert_match "filename is an ae symbol"

# fails with because %e6 is not valid utf-8 percent encoding
assert_command_fail curl --fail -vv http://localhost:"$PORT"/%e6?canisterId="$ID"
Expand Down
Loading