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

blobfuse2 mount with "set-content-type=true" is case sensitive for file extensions, should be case insensitive. #1237

Closed
ziggy90127 opened this issue Sep 1, 2023 · 1 comment · Fixed by #1242
Assignees
Milestone

Comments

@ziggy90127
Copy link

Which version of blobfuse was used?

blobfuse2/bullseye,now 2.1.0 amd64 [installed]

Which OS distribution and version are you using?

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

If relevant, please share your mount command.

sudo blobfuse2 mount ~/mycontainer --config-file=mycontainer.yaml --set-content-type=true

What was the issue encountered?

"set-content-type=true" is case sensitive for file extensions, should be case insensitive.

Have you found a mitigation/solution?

no

Please share logs if available.

blobfuse2 mount with "set-content-type=true" is case sensitive for file extensions, should be case insensitive.

A file ending with .jpg will correctly get the content-type set to image/jpeg.
A file ending with .JPG will incorrectly get the content-type set to application/octet-stream.
I say "incorrectly" because azcopy will set both files to image/jpeg.

cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

mkdir ~/ext4
touch ext4/a.jpg
touch ext4/b.JPG
azcopy -v
azcopy version 10.20.1
azcopy copy a.jpg "https://.blob.core.windows.net/azcopy?sv="
azcopy copy b.JPG "https://.blob.core.windows.net/azcopy?sv="

For https://.blob.core.windows.net/azcopy/a.jpg portal.azure.com shows:
Content-type image/jpeg
For https://.blob.core.windows.net/azcopy/b.JPG portal.azure.com shows:
Content-type image/jpeg

mkdir ~/mycontainer
cat > mycontainer.yaml << EOL
allow-other: true

logging:
type: syslog
level: log_debug

components:

  • libfuse
  • stream
  • attr_cache
  • azstorage

libfuse:
attribute-expiration-sec: 120
entry-expiration-sec: 120
negative-entry-expiration-sec: 240

stream:
block-size-mb: 8
blocks-per-file: 3
cache-size-mb: 1024

attr_cache:
timeout-sec: 7200

azstorage:
type: block
account-name:
account-key:
endpoint: https://.blob.core.windows.net
mode: key
container: mycontainer
EOL

apt list blobfuse2
Listing... Done
blobfuse2/bullseye,now 2.1.0 amd64 [installed]
sudo blobfuse2 mount ~/mycontainer --config-file=mycontainer.yaml --set-content-type=true

touch mycontainer/a.jpg
touch mycontainer/b.JPG

For https://.blob.core.windows.net/mycontainer/a.jpg portal.azure.com shows:
Content-type image/jpeg
For https://.blob.core.windows.net/mycontainer/b.JPG portal.azure.com shows:
Content-type application/octet-stream

@vibhansa-msft
Copy link
Member

We will look into this and fix it in next release.

@vibhansa-msft vibhansa-msft self-assigned this Sep 4, 2023
@vibhansa-msft vibhansa-msft linked a pull request Sep 7, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants