Skip to content

[bug] audio tag using a asset resource file as the source, the asset server returns wrong content-type of text/html #5203

@nathanfaucett

Description

@nathanfaucett

Describe the bug

audio tag using a asset resource file as the source, the asset server returns wrong content-type of text/html

Reproduction

create project with audio files in bundle.resources create a filepath using something like

const filePath = convertFileSrc(
	await normalize(
		await resolveResource('name_of_audio_file.mp3')
	)
)

use in audio tag <audio controls><source src="{filePath}" type="audio/mpeg" /></audio>

Screen Shot 2022-09-15 at 16 53 31

Expected behavior

the content type to be audio/mpeg

Platform and versions

Environment
› OS: Mac OS 12.2.1 X64
› Node.js: 16.15.0
› npm: 8.8.0
› pnpm: 7.0.0
› yarn: Not installed!
› rustup: 1.25.1
› rustc: 1.63.0
› cargo: 1.63.0
› Rust toolchain: stable-aarch64-apple-darwin

Packages
› @tauri-apps/cli [NPM]: 1.1.0
› @tauri-apps/api [NPM]: 1.1.0
› tauri [RUST]: 1.1.0,
› tauri-build [RUST]: 1.1.0,
› tao [RUST]: 0.14.0,
› wry [RUST]: 0.21.0,

App
› build-type: bundle
› CSP: default-src 'self'; img-src 'self' asset: https://asset.localhost; media-src 'self' asset: https://asset.localhost;
› distDir: ../dist
› devPath: http://localhost:3000/
› framework: Svelte

App directory structure
├─ node_modules
├─ public
├─ src-tauri
├─ .git
├─ .vscode
└─ src

Stack trace

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions