rwf2/Rocket

Allow wildcards in content-type

オープン

#583 opened on 2018/03/11

 (6 件のコメント) (5 件のリアクション) (0 人の担当者)Rust (1,645 件のフォーク)batch import
enhancementgood first issue

Repository metrics

Stars
 (25,738 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Currently (Rocket version 0.4.0-dev) if you use a wildcard in content-type you will get a warning like this:

warning: 'image/*' is not a known media type
 --> src/handlers/image.rs:5:33
  |
5 | #[post("/image", format = "image/*", data = "<data>")]
  |                                 ^^^^^^^^^

Using wildcard e.g. for images is needed as you do not know what the actual type of the image will be (png, gif, jpg etc.) and you want to handle all of them in the same route.

コントリビューターガイド