Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • F File Repository
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Genesys PGRGenesys PGR
  • File Repository
  • Merge requests
  • !66

Extract zip: Ignore content type and check extension

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Matija Obreza requested to merge unzip-ignore-content-type into main Sep 28, 2022
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 2

It appears that zip archives from Windows sometimes come with content type application/x-zip-compressed. In that case, the user cannot unzip the archive because we check for application/zip only:

{"error":"Incompatible content type for extracting: application/x-zip-compressed","localizedError":"Incompatible content type for extracting: application/x-zip-compressed"}

This MR changes the first test to inspect only that file.extension == '.zip' (before loading bytes) and then wraps the unzipping operation in a try () { } block.

Edited Sep 28, 2022 by Matija Obreza
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: unzip-ignore-content-type