rwf2/Rocket

Allow wildcards in content-type

开放

#583 创建于 2018年3月11日

 (6 条评论) (5 个反应) (0 位负责人)Rust (1,645 个派生)batch import
enhancementgood first issue

仓库指标

星标
 (25,738 个星标)
PR 合并指标
 (30 天内没有已合并 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.

贡献者指南