Skip to content

Commit

Permalink
Fix for enumerate_parts_with_files prototype and implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
eao197 committed Nov 11, 2019
1 parent 267ec66 commit 546cc23
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions dev/restinio/helpers/file_upload.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,15 @@ struct valid_handler_type<
template< typename Handler >
expected_t< std::size_t, enumeration_error_t >
enumerate_parts_with_files(
//! Request to be processed.
const request_t & req,
Handler && handler )
//! Handler to be called for every part with uploaded file.
Handler && handler,
//! The value of 'type' part of media-type in Content-Type field.
//! Please note: the special value '*' is not supported here.
string_view_t expected_media_type = string_view_t{"multipart"},
//! The value of 'subtype' part of media-type in Content-Type field.
string_view_t expected_media_subtype = string_view_t{"form-data"} )
{
static_assert(
impl::valid_handler_type< std::decay_t<Handler> >::value,
Expand Down Expand Up @@ -392,8 +399,8 @@ enumerate_parts_with_files(
return handling_result_t::terminate_enumeration;
}
},
"multipart",
"form-data" );
expected_media_type,
expected_media_subtype );

if( error )
return make_unexpected( *error );
Expand Down

0 comments on commit 546cc23

Please sign in to comment.