You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can see a bug where, when CMCD is being used with an existing URL-encoded query arg that includes %20 (spaces), these are changed to '+'. This can be illustrated with the following manifest playback
without CMCD-query args active, then the player makes the correct request to the server. If however we turn on CMCD query args, then it makes this request to the server
The native URLSearchParams implementation automatically replaces whitespaces with + signs as soon as we add a new query parameters using modifiedUrl.searchParams.set(param.key, param.value).
Percent-encoding uses three characters to represent a reserved character. The first is the percent sign %, and this is followed by the two-character hexadecimal value of the reserved ASCII character. The two-character hexadecimal value is not case sensitive.
The conversion from %3d to %3D also happens automatically once we call modifiedUrl.searchParams.set(param.key, param.value).
Environment
Steps to reproduce
I can see a bug where, when CMCD is being used with an existing URL-encoded query arg that includes %20 (spaces), these are changed to '+'. This can be illustrated with the following manifest playback
https://reference.dashif.org/dash.js/latest/samples/dash-if-reference-player/index.html?mpd=https%3A%2F%2Fdash.akamaized.net%2Fakamai%2Fbbb_30fps%2Fbbb_30fps.mpd%3Fa%3Dsomehting%20with%20spaces+&debug.logLevel=4&streaming.delay.liveDelayFragmentCount=NaN&streaming.delay.liveDelay=NaN&streaming.buffer.initialBufferLevel=NaN&streaming.liveCatchup.maxDrift=NaN&streaming.liveCatchup.playbackRate.min=NaN&streaming.liveCatchup.playbackRate.max=NaN
which shows in the javascript panel the correct request to the server of
https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd?a=somehting%20with%20spaces
However, if we turn on CMCD with query-arg mode and try the same manifest
https://reference.dashif.org/dash.js/latest/samples/dash-if-reference-player/index.html?mpd=https%3A%2F%2Fdash.akamaized.net%2Fakamai%2Fbbb_30fps%2Fbbb_30fps.mpd%3Fa%3Dsomehting%20with%20spaces+&debug.logLevel=4&streaming.delay.liveDelayFragmentCount=NaN&streaming.delay.liveDelay=NaN&streaming.buffer.initialBufferLevel=NaN&streaming.liveCatchup.maxDrift=NaN&streaming.liveCatchup.playbackRate.min=NaN&streaming.liveCatchup.playbackRate.max=NaN&streaming.cmcd.enabled=true
then we see that the request to the server looks like this:
https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd?a=somehting+with+spaces&CMCD=ot%3Dm%2Csid%3D%22d336fd7a-178d-4dfe-b180-809fa58af3c6%22
where the original query arg has been modified.
We can also see with a change in capitalization. If we try to play the URL
https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd?a=%3d
without CMCD-query args active, then the player makes the correct request to the server. If however we turn on CMCD query args, then it makes this request to the server
https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd?a=%3D&CMCD=ot%3Dm%2Csid%3D%22b7b542be-8f66-4834-aedf-4fcd4883a449%22
in which the %3d had been converted to %3D. This breaks any server which is hashing the URL in order to decide if an access token is valid.
The text was updated successfully, but these errors were encountered: