-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Binary Upload (Fixes #2126)
- Loading branch information
Showing
5 changed files
with
139 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash -e | ||
|
||
# This script creates a large binary resource (8 MiB) and verifies that its binary content | ||
# can be read correctly via both JSON/XML wrappers and direct binary upload. | ||
|
||
BASE="http://localhost:8080/fhir" | ||
|
||
# 8 MiB of random data (8388608 bytes), kept in memory | ||
DATA="$(openssl rand 8388608 | tr -d '\n')" | ||
|
||
echo "Testing direct binary upload and download..." | ||
|
||
# Create Binary resource via direct binary upload | ||
ID=$(curl -s -H 'Content-Type: application/octet-stream' --data-binary "$DATA" "$BASE/Binary" | jq -r '.id') | ||
|
||
echo "Created Binary resource via direct binary upload with ID: $ID" | ||
|
||
# Retrieve and verify via direct binary | ||
BASE64_ENCODED_BINARY_RESOURCE_VIA_DIRECT=$(curl -s -H 'Accept: application/octet-stream' "$BASE/Binary/$ID") | ||
|
||
if [ "$DATA" = "$BASE64_ENCODED_BINARY_RESOURCE_VIA_DIRECT" ]; then | ||
echo "✅ Direct Binary: Successfully verified 8 MiB binary content integrity" | ||
else | ||
echo "🆘 Direct Binary: Content verification failed" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters