Fork me on GitHub
#ring
<
2019-05-30
>
jeaye20:05:41

I've hit an odd issue. Using the default lein new compojure mp4 template and then modifying a bit, I've created a 12 line handler ns which serves up some public resources. The only resource is an index.html which plays a video. This works perfectly in my web browser, and on my Android device. However, the video doesn't play on iOS. After enumerating every possible H.256 profile for the video, I realized it had nothing to do with the video itself and was instead due to the HTTP response given for the video. To my surprise, I can view the same site using npx http-server and it works on iOS just fine. So, what is ring doing wrong, or what am I doing wrong with ring such that videos on iOS won't work? To make this easy, a complete and absolutely minimal test case repo: https://github.com/jeaye/lein-ring-mp4

jeaye21:05:17

More completely, the response from Ring:

< HTTP/1.1 200 OK
< Date: Thu, 30 May 2019 20:58:20 GMT
< Last-Modified: Thu, 30 May 2019 20:41:42 GMT
< Content-Type: video/mp4
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< X-Content-Type-Options: nosniff
< Content-Length: 9048957
< Server: Jetty(9.2.21.v20170120)
And the response from npx http-server:
< HTTP/1.1 200 OK
< server: ecstatic-3.3.2
< cache-control: max-age=3600
< last-modified: Wed, 29 May 2019 22:13:55 GMT
< etag: W/"681886-9048957-2019-05-29T22:13:55.245Z"
< content-length: 9048957
< content-type: video/mp4; charset=utf-8
< Date: Thu, 30 May 2019 20:56:57 GMT
< Connection: keep-alive
Note that the content type for the latter includes ; charset=utf-8, which may be unrelated but is still noteworthy.