rwf2/Rocket

Allow wildcards in content-type

Aberta

#583 aberto em 11 de mar. de 2018

 (6 comentários) (5 reações) (0 responsável)Rust (1.645 forks)batch import
enhancementgood first issue

Métricas do repositório

Stars
 (25.738 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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.

Guia do colaborador