mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-26 15:07:42 +02:00
actix-multipart: Feature: Add typed multipart form extractor (#2883)
Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
16
actix-multipart-derive/tests/trybuild/deny-unknown.rs
Normal file
16
actix-multipart-derive/tests/trybuild/deny-unknown.rs
Normal file
@ -0,0 +1,16 @@
|
||||
use actix_web::{web, App, Responder};
|
||||
|
||||
use actix_multipart::form::MultipartForm;
|
||||
|
||||
#[derive(MultipartForm)]
|
||||
#[multipart(deny_unknown_fields)]
|
||||
struct Form {}
|
||||
|
||||
async fn handler(_form: MultipartForm<Form>) -> impl Responder {
|
||||
"Hello World!"
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() {
|
||||
App::new().default_service(web::to(handler));
|
||||
}
|
Reference in New Issue
Block a user