-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to add wasm(WebAssembly)and etc content-type? #450
Comments
Take a look at the |
Thanks for the hint. But it doesn't work. When loading js from the html side, the address… Do I have to wrap the route by pulling out unity in advance? And when I go to the map and set content-type as the key and application/wasm as the value, the result is the same. The webgl page itself doesn't use index.html but loads unity webgl js from hiccup so I'm not sure what to do anymore. So I wonder if this suspicion is correct... (Actually, the program runs without problems. I just want to make sure I catch errors and warnings.) |
Can you show me what you're doing when you say it doesn't work? Also, how are you serving the wasm files? I assume as a public resource? |
I can't upload the project as it is because will work, so I'll make a simple example and upload it. Please understand that it may be late. thank you. |
It's so late, I'm sorry. After a few months of work end it, For Unity webgl compilation, there are two ways to compress wasm once (br and gzip method). Please take a look, and I hope you catch the error by adding content-type: . |
I've been waiting for you to upload the example. There doesn't seem to be one linked or attached to the issue. |
hmm i'm solve! sorry~. ;; unity webgl build gzip & compression fallback? (check) And I'm not sure if this has any effect... Later, not unity wasm, other c++ or rust or godot (tools I want to deal with) |
I'm using ring.middleware.cors with unity3d wasm.
error:
wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
warning:
HTTP Response Header "Content-Type" configured incorrectly on the server for file Build/MyGame.wasm , should be "application/wasm". Startup time performance will suffer.
(def ring-middle
(-> ROUTE/my-route
RING-MIDDLEWARE-JSON/wrap-json-body
RING-MIDDLEWARE-JSON/wrap-json-response
(RING-MIDDLEWARE-DEFAULTS/wrap-defaults
RING-MIDDLEWARE-DEFAULTS/site-defaults)
(RING-MIDDLEWARE-CORS/wrap-cors
:access-control-allow-credentials "true"
:access-control-allow-origin [#".*"]
:access-control-allow-headers #{"accept"
"accept-encoding"
"accept-language"
"authorization"
"content-type"
"origin"}
;; I want to add mime-types. "content-type:... "application/wasm br gz javascript" ... etc
:access-control-allow-methods [:get :put :post :delete :options])
))
The text was updated successfully, but these errors were encountered: