- GitHub Staff
- https://reb.gg
- @robherley
When trying to call Blob Batch Delete API via Azure Go SDK, any requests to blob paths with /
don't correctly form the Authorization header that the server is expecting.
2023/09/28 15:10:12 uploading "file1.txt" with content "This can be deleted"
2023/09/28 15:10:12 uploading "foo/bar/file2.txt" with content "This can't be deleted"
2023/09/28 15:10:12 ℹ️ deleting "file1.txt"
I'm using Azurite for some integration tests, and I noticed some odd behavior with the Blob Batch API when using a hostname instead of an IP address.
Related to:
- Azure/Azurite#1039 (specifically this comment)
The subrequests will fail when calling delete with a hostname with ResourceNotFound
because it's incorrectly calculating the account and container names.
For example, for the request:
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
package main | |
import ( | |
"archive/zip" | |
"io" | |
"net/http" | |
"path/filepath" | |
) | |
func downloadZips(w io.Writer) error { |
Run go run main.go
to test:
2023/04/25 17:02:26.660597 blob size is 10592348960 bytes, which is ~ 10101 MB
2023/04/25 17:02:26.660668 reading 1024 bytes from azblob from offset 10592347936
2023/04/25 17:02:26.680128 reading 20 bytes from azblob from offset 10592348918
2023/04/25 17:02:26.695184 reading 56 bytes from azblob from offset 10592348862
2023/04/25 17:02:26.710803 reading 4096 bytes from azblob from offset 10592340479
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
# set manual | |
ipmitool -I lanplus -H 10.0.0.99 -U root -P '<pass>' raw 0x30 0x30 0x01 0x00 | |
# 15% | |
ipmitool -I lanplus -H 10.0.0.99 -U root -P '<pass>' raw 0x30 0x30 0x02 0xff 0x0f |
This file has been truncated, but you can view the full file.
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
A:01 F:B0 B:00 C:13 D:00 E:D8 H:01 L:4D SP:FFFE PC:0100 PCMEM:00,C3,13,02 | |
A:01 F:B0 B:00 C:13 D:00 E:D8 H:01 L:4D SP:FFFE PC:0101 PCMEM:C3,13,02,CE | |
A:01 F:B0 B:00 C:13 D:00 E:D8 H:01 L:4D SP:FFFE PC:0213 PCMEM:21,00,40,C3 | |
A:01 F:B0 B:00 C:13 D:00 E:D8 H:40 L:00 SP:FFFE PC:0216 PCMEM:C3,00,02,00 | |
A:01 F:B0 B:00 C:13 D:00 E:D8 H:40 L:00 SP:FFFE PC:0200 PCMEM:47,11,00,C0 | |
A:01 F:B0 B:01 C:13 D:00 E:D8 H:40 L:00 SP:FFFE PC:0201 PCMEM:11,00,C0,0E | |
A:01 F:B0 B:01 C:13 D:C0 E:00 H:40 L:00 SP:FFFE PC:0204 PCMEM:0E,10,2A,12 | |
A:01 F:B0 B:01 C:10 D:C0 E:00 H:40 L:00 SP:FFFE PC:0206 PCMEM:2A,12,1C,20 | |
A:C3 F:B0 B:01 C:10 D:C0 E:00 H:40 L:01 SP:FFFE PC:0207 PCMEM:12,1C,20,FB | |
A:C3 F:B0 B:01 C:10 D:C0 E:00 H:40 L:01 SP:FFFE PC:0208 PCMEM:1C,20,FB,14 |
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
#!/usr/bin/env bash | |
KEY="SOMETHING-$(date -u +%Y-%m-%dT%H:%M:%SZ)" | |
ACCOUNT_KEY="SOMETHING-ELSE" | |
# sign <key> <account key> | |
function sign(){ | |
b64_key=$(echo -n "$2" | base64) | |
payload=$(echo -n "$1" | openssl sha256 -hmac "$b64_key") |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"sort" | |
) |
NewerOlder