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

Simple file validation and HTML5 zip correction #4867

Open
wants to merge 4 commits into
base: unstable
Choose a base branch
from

Conversation

rtibbles
Copy link
Member

@rtibbles rtibbles commented Jan 7, 2025

Summary

  • Adds simple validation of image, video, and audio files
  • Adds utility for creating predictable zip files that gives an exact MD5 match for those created by ricecooker
  • Adds validation for HTML5 files
  • Adds cleaning to process HTML5 files to remove unnecessary folder nesting
  • If index.html is not present, finds first available html file to use as entry point
  • Rezips all uploaded zip files as predictable zips to have parallel implementation to ricecooker

References

Fixes #4013

Reviewer guidance

I think the 'first available html file' might be better handled by asking the user which one they want to use, but this would require a lot more work to enable.

Testing this is best done by taking an existing HTML5 app and messing about with it, unzip it, put its contents in a bunch of nested folders, and then rezip it. If appropriate, rename the index.html to something else and make sure it still works (this will only work reliably if there are no other html files in the root of the zip).

@rtibbles rtibbles marked this pull request as draft January 7, 2025 18:47
@rtibbles rtibbles marked this pull request as ready for review January 7, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate against and attempt fixing of incorrectly formatted HTML5 ZIPs
2 participants