Skip to content
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

Define behavior if sanitized data is empty #61

Closed
ddorwin opened this issue May 26, 2015 · 3 comments
Closed

Define behavior if sanitized data is empty #61

ddorwin opened this issue May 26, 2015 · 3 comments
Assignees
Milestone

Comments

@ddorwin
Copy link
Contributor

ddorwin commented May 26, 2015

In all cases where data is sanitized, the next steps says, "If the previous step failed, reject promise..." This should probably say, "If the previous step failed or the sanitized data is empty, reject promise..."

For init data, the issue is a little more complex. The sanitization step says to "remove entries that are not needed by the CDM," which could result in an empty sanitized init data. If the promise is rejected there, InvalidAccessError would be used. However, the original intent before sanitization and currently-defined behavior would be for the CDM to reject the promise with NotSupportedError, which is more accurate - the initData did not contain data supported by this CDM.

@jdsmith3000
Copy link
Contributor

I agree with both proposals: empty sanitized data should reject the promise with InvalidAccessError in normal cases, and Not SupportedError for sanitized init data.

@ddorwin ddorwin modified the milestone: V1 Oct 16, 2015
@mwatson2
Copy link
Contributor

Shouldn't it be up to the CDM whether empty data is valid or not ? I know all existing CDMs expect something in the initData, but I don't see any reason why a CDM could not be made which accepted empty initData as valid.

@joeyparrish
Copy link
Member

I agree with @jdsmith3000. NotSupportedError communicates the correct information to the application if all init data was sanitized away.

I've had discussions about this very thing with app developers who were confused about InvalidAccessError and couldn't understand that they were passing only unusable init data. A specific error to indicate that the init data wasn't invalid per se, but merely not supported by this CDM, would allow an app developer to recognize their own mistake and fix their app without several round trips to a CDM vendor's support people.

@mwatson2 I don't see any reason empty data should be considered valid without a specific use-case for this. It doesn't seem to add any value, and nobody seems to do it or need it today.

@mwatson2 mwatson2 self-assigned this Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants