ZIP imports fail on uncommon filetypes
まだ誰も着手していません。
評価
調査の方向性
まず ZIP インポートの経路と、manifest.json および Python の mimetypes ライブラリが ContentType をどのように決定するかを追跡します。.webp や .avif のような一般的でない種類について、ブラウザーのアップロード経路と比較します。ZIP インポートが報告された検証エラーなしで受け入れられるファイルを処理し、影響を受けるファイルタイプのカバレッジがあれば完了です。
索引モデルが issue の本文から書いたものです。
説明
In Zendesk 9788, a user reported this error being displayed when they tried to import a ZIP created using the export function originally discussed in #304
Parameter validation failed: Invalid type for parameter ContentType, value: None, type: , valid types:
It turns out that the python mimetypes library on our production system fails to guess the type of .webp and .avif files, among others. There's an asymmetry in that, when uploaded, the browser reports the mime type, so users of the editor can introduce these files without a hitch, but the import process doesn't know what the mimetype was.
The workaround, in this case, was to remove the problem files from the ZIP, import the rest of the archive, and then use the editor to re-upload the single .webp file which was actually being used (the rest were not used in the storymap)
A partial solution would be to configure mimetypes to understand more filetypes. .webp seems pretty natural. I was unfamiliar with .avif but CanIUse reports that most browsers except Edge support it. Still, this kind of kicks the can down the road without necessarily solving it.
Another option, which may not actually be possible, would be to write the mime types into the manifest.json included in the export ZIP, if we can recover them, perhaps from boto. Using this instead of "guessing" should ensure that any file we've accepted through the editor can also be accepted through the import.
See also #487 which suggests limiting which files are included in exports. In this case it would have filtered out most, but not all, of the uncommon filetypes.
- 主要言語
- JavaScript
- スター
- 248
- フォーク
- 61
- 平均マージ
- 1分
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NUKnightLab/StoryMapJS のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
NUKnightLab/StoryMapJS#507 ·
-
Visual glitches オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
NUKnightLab/StoryMapJS#506 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
NUKnightLab/StoryMapJS#505 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 50/100
NUKnightLab/StoryMapJS#495 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
NUKnightLab/StoryMapJS#487 ·
NUKnightLab/StoryMapJS の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
antfu-collective/icones#398 ·
-
ECmail.com オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
wesbos/burner-email-providers#554 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
components-web-app/docs#92 ·