korlibs / korlibs/korge

Hosting on GH Pages doesn't work after allowing UrlVfs to support downloads without length

Open
#687 12 comments 0 reactions 1 assignee Claimed by @soywiz View on GitHub
bug
Dominant language
Kotlin
Stars
3k
Forks
148
Avg merge
13h 44m
Merged PRs (30d)
1

Description

I have "unsupported" error logged in console when my game hosted on GitHub pages reads something from `resourcesVfs`: https://servb.github.io/pph/.

The stacktrace is as follows:
```
stt@https://servb.github.io/pph/PPH.js:1:66527
f_t@https://servb.github.io/pph/PPH.js:1:78130
vvt@https://servb.github.io/pph/PPH.js:1:173929
_/Ryt.prototype.doResume_0_k$@https://servb.github.io/pph/PPH.js:1:1163768
_/Iyt.prototype.getLength_0_k$@https://servb.github.io/pph/PPH.js:1:1164457
_/Wgt.prototype.getLength_0_k$@https://servb.github.io/pph/PPH.js:1:1235904
_/Ngt.prototype.getLength_0_k$@https://servb.github.io/pph/PPH.js:1:1230018
_/L$t.prototype.doResume_0_k$@https://servb.github.io/pph/PPH.js:1:813992
_/N$t.prototype.doResume_0_k$@https://servb.github.io/pph/PPH.js:1:813308
_/C$t.prototype.invoke_u23hy3_k$@https://servb.github.io/pph/PPH.js:1:813715
_/Gyt.prototype.doResume_0_k$@https://servb.github.io/pph/PPH.js:1:1179499
_/Byt.prototype.doResume_0_k$@https://servb.github.io/pph/PPH.js:1:1179071
_/zet.prototype.resumeWith_jccoe6_k$@https://servb.github.io/pph/PPH.js:1:572195
_/zet.prototype.resumeWith_bnunh2_k$@https://servb.github.io/pph/PPH.js:1:572511
_/cft.prototype.run_sv8swh_k$@https://servb.github.io/pph/PPH.js:1:770171
_/GYt.prototype.executePending_zah5t7_k$@https://servb.github.io/pph/PPH.js:1:1732452
_/uJt.prototype.invoke_okcceq_k$@https://servb.github.io/pph/PPH.js:1:1759970
hJt/this._jsFrame
```

I've debugged a bit and see that `HEAD https://servb.github.io/pph/resources.zip` request doesn't return Content-Length header, so `UrlVfs$AsyncStreamBase::getLength` returns `unsupported()`:

![image](https://user-images.githubusercontent.com/20105593/126074502-b55404cf-8542-4bde-b068-2e3a65dc16de.png)

It seems that GitHub Pages just doesn't provide this header. When launching locally via `runJs`, everything works fine. I guess my game worked on GH Pages before b9cfc00, but now it doesn't.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.