normalizing media URIs before sending the request
joeri.sykora at gluonhq.com
Tue Jun 9 11:41:25 UTC 2020
JavaFX media has support for parsing HLS M3U media playlist files. Such a
m3u (or m3u8) file contains a list of URIs to the actual media files. These
URIs are currently not normalized before the HTTP request is made, which
can cause issues in case the URI contains .. segments. For example, try
loading the following playlist with the JavaFX media player:
It will ultimately try to request the following URL:
which fails because the HTTP server responds with a 403 response.
An easy fix is to normalize the URI (see
before making the request in the following sections
This time, the request will succeed and the media can be played by JavaFX.
The only issue with this fix, is that it is a change in existing behaviour.
On the other hand, all browsers that I've tested, first normalize the URI
when loading it. The same is true when loading the URI with cURL or other
media players I've tested. You can simulate the failing behaviour with cURL
when providing the --path-as-is option:
curl -I --path-as-is
I have a strong preference of changing the default behaviour to normalize
URIs before making the request. What are your opinions?
*Gluon*E: joeri.sykora at gluonhq.com
More information about the openjfx-dev