We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0e3239 commit 6b19269Copy full SHA for 6b19269
src/main.rs
@@ -509,16 +509,13 @@ impl MainHandler {
509
match multipart.save().size_limit(self.upload_size_limit).temp() {
510
SaveResult::Full(entries) => {
511
// Pull out csrf field to check if token matches one generated
512
- let csrf_field = match entries.fields.get("csrf") {
513
- Some(fields) => match fields.first() {
514
- Some(field) => field,
515
- None => {
516
- return Err((
517
- status::BadRequest,
518
- String::from("csrf parameter not provided"),
519
- ))
520
- }
521
- },
+ let csrf_field = match entries
+ .fields
+ .get("csrf")
+ .map(|fields| fields.first())
+ .unwrap_or(None)
+ {
+ Some(field) => field,
522
None => {
523
return Err((
524
status::BadRequest,
0 commit comments