Skip to content

fix(utils): match file extensions case-insensitively in MimeType - #16447

Merged
Legend-Master merged 1 commit into
tauri-apps:devfrom
b84330808:fix-mime-uppercase-extension
Nov 3, 2026
Merged

Legend-Master merged 1 commit into
tauri-apps:devfrom
b84330808:fix-mime-uppercase-extension

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

MimeType::parse_from_uri_with_fallback matched the extension case-sensitively, so a file like app.JS or Style.CSS got the fallback type, which is text/html for the tauri:// and asset protocols. The webview then refuses to run app.JS as a module script. parse_with_fallback also only skipped infer for a lowercase .svg, so Logo.SVG came back as text/html, or text/xml if it starts with <?xml, and doesn't render in an <img>.

This lowercases the extension before matching and makes the .svg check case-insensitive. Added a test (should_ignore_extension_case) and a change file for tauri-utils.

I used Claude Code to write this change.

`MimeType::parse_from_uri_with_fallback` compared the extension
case-sensitively, so `app.JS` or `Style.CSS` fell through to the
fallback (`text/html` for the `tauri://` and asset protocols), and
`parse_with_fallback` only skipped `infer` for a lowercase `.svg`, so
`Logo.SVG` was served as `text/html` or `text/xml`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@Legend-Master Legend-Master left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Package Changes Through 4fd24c2

There are 7 changes which include @tauri-apps/api with patch, tauri-bundler with patch, tauri-cli with patch, @tauri-apps/cli with patch, tauri with patch, tauri-runtime-wry with patch, tauri-utils with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.12.4 2.12.5
tauri-utils 2.10.2 2.10.3
tauri-bundler 2.10.4 2.10.5
tauri-runtime 2.12.2 2.12.3
tauri-runtime-wry 2.12.3 2.12.4
tauri-codegen 2.7.4 2.7.5
tauri-macros 2.7.4 2.7.5
tauri-plugin 2.7.2 2.7.3
tauri-build 2.7.4 2.7.5
tauri 2.12.5 2.12.6
@tauri-apps/cli 2.12.4 2.12.5
tauri-cli 2.12.4 2.12.5

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@Legend-Master
Legend-Master merged commit c51f047 into tauri-apps:dev Nov 3, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants