rwf2/Rocket

Allow wildcards in content-type

Offen

#583 geöffnet am 11.03.2018

 (6 Kommentare) (5 Reaktionen) (0 zugewiesene Personen)Rust (1.645 Forks)batch import
enhancementgood first issue

Repository-Metriken

Stars
 (25.738 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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.

Contributor Guide