Skip to content

Conversation

@marcos-hairpieces
Copy link
Contributor

Prevents corruption of binary files (images, videos, audio, PDFs) by passing streams through as-is instead of reading them as text for WebDAV content requests.

What?

This pull request fixes an issue where binary files (such as images, videos, audio, PDFs) served via WebDAV endpoints were being corrupted. The bug was caused by reading binary streams as text, which altered the file contents. The new logic detects binary content types and passes their streams through as-is, preventing corruption.

The regression was introduced in commit 20e1143e54c0ccfb2197c16b654ee5b098399ec9, which changed how streams were handled for WebDAV requests.

Tickets / Documentation

No existing tickets or documentation were found for this issue. The problem was identified and traced to the above commit.

Steps to Test

  1. Add a binary file (e.g., test.png) to the WebDAV directory: /content/images/test.png.
  2. Reference this image in your theme or access it directly perhaps via: /content/images/test.png in an img tag.
  3. Before this fix, the image would be corrupted and not display correctly in the browser.
  4. After this fix, the image should display correctly without corruption.

Screenshots (if appropriate)

  1. How webdav images were being displayed before this change
image image
  1. How webdav images are being displayed after this change
image

cc @bigcommerce/storefront-team

Prevents corruption of binary files (images, videos, audio, PDFs)
by passing streams through as-is instead of reading them as text
for WebDAV content requests.
@marcos-hairpieces marcos-hairpieces force-pushed the fix/webdav-binary-content-handling branch from 0f709f4 to a46c4c6 Compare October 16, 2025 15:56
@jairo-bc jairo-bc merged commit 092781d into bigcommerce:master Oct 28, 2025
10 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 8.10.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants