-
Notifications
You must be signed in to change notification settings - Fork 107
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
Correct Mimetype for LCPL UTI #194
Comments
Ha nice catch, I quickly fixed it in
I'm actually more worried about the apps that copied the test app's
I've been working on a Swift implementation of a new Format API proposal which will replace the media type check done in Your issue gave me a cool idea: registering dynamically the UTIs referenced in Meaning that if you have that in your <dict>
<key>UTTypeIdentifier</key>
<string>org.readium.lcpl</string>
<key>UTTypeDescription</key>
<string>Lightweight Content Protection License</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>lcpl</string>
</array>
<key>public.mime-type</key>
<string>application/vnd.readium.lcp.license.v1.0+json</string>
</dict>
</dict> Then it will automatically be registered in let format1 = Format.of(mediaTypes: ["application/vnd.readium.lcp.license.v1.0+json"])
let format2 = Format.of(fileExtensions: ["lcpl"])
format1 == format2 == Format(
name: "Lightweight Content Protection License",
mediaType: MediaType("application/vnd.readium.lcp.license.v1.0+json"),
fileExtension: "lcpl"
) |
Nice that was fast!
Wow, that's quite a thorough document. I confess I didn't read the whole thing, but seems like you're handling all of the corner cases.
Sounds good as well. One further idea, is that in the the Of course, that would merely be a stopgap until your new Format API goes into effect, but it's an idea. |
Yes in particular for the media type comparison, we tried to be a bit more systematic. The gist of the improvements that this API brings are:
Good idea, actually this will also be useful after the new Format API is available, since reading apps might still use |
Okay great. If you fixed the plist entry I suppose this ticket is done, good to close? |
Yes, I just wanted to make the changes mentioned in I actually kept You're free to close this issue if there's nothing further to discuss with these changes. |
Okay, I read through those two commits/diffs. Wow, that's quite a lot of code! It looks good to me. I agree with the concept of consulting the info.plist internally rather than what has been registered with the system by potentially multiple apps. We're good now, closing! |
The app's plist file defines the
org.readium.lcpl
UTI. It gives as the mimetype for this UTIapplication/vnd.readium.lcp.license.v1.0
which is incorrect, because per the spec the correct one isapplication/vnd.readium.lcp.license.v1.0+json
.By a series of unfortunate events, if both the test app and another app (with correct mimetype) are installed on a device, the test app can hijack the UTI (since it can only be registered once with the system).
Further, then, if a particular OPDS feed contains acquisition links with no
.lcpl
extension, thePublication.downloadLinks
getter then falls back to mimetype, and if your mimetype is hijacked and wrong, then you can't download anything, which is possibly confusing :)Point is, would be good to correct the LCPL mimetype in the plist.
The text was updated successfully, but these errors were encountered: