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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: yarco at 139 dot com
New email:
PHP Version: OS:

 

 [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-2020 The PHP Group
All rights reserved.
Last updated: Wed Nov 25 09:01:23 2020 UTC