php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #80195 WASM mimetype is not supported in php internal sever
Submitted: 2020-10-07 10:14 UTC Modified: 2020-10-09 14:24 UTC
From: yarco at 139 dot com Assigned:
Status: Open Package: Built-in web server
PHP Version: Irrelevant OS: Mac OS / Homebrew
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-10-07 10:14 UTC] yarco at 139 dot com
Description:
------------
WASM (*.wasm) is the webassembly program. And it seems will be the future for at least it runs fine in modern browser environment.
I'm trying to run it by using `php -S 127.0.0.1:8000 -t .` , and local directory contains "main.html", "main.js", "main.wasm" (those generated by emcc which is a warm compiler). The script "main.js" (or maybe main.html) will load "main.wasm" somewhere. And the browser tells me under the console:

wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.

It seems when sending "main.wasm", it didn't set the header `application/wasm`.
(I think PHP should take care of those modern features...)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-07 10:53 UTC] cmb@php.net
Apparently, application/wasm has not yet been registered with
IANA[1].

[1] <https://www.iana.org/assignments/media-types/media-types.xhtml>
 [2020-10-09 14:24 UTC] nikic@php.net
We support .wasm in PHP 8.0 as part of the switch to mime-db.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC