Skip to content

Commit

Permalink
Use String::length(), even though in this case size() works too.
Browse files Browse the repository at this point in the history
  • Loading branch information
Relintai committed Mar 10, 2024
1 parent 27d97cf commit 75e8f68
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/http_server_simple/http_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ void HTTPParser::_process_multipart_header_value(const String &val) {

if (_multipart_form_name.length() >= 2 && _multipart_form_name.begins_with("\"") && _multipart_form_name.ends_with("\"")) {
_multipart_form_name.remove(0);
//TODO check if this should be _multipart_form_name.remove(_multipart_form_name.length() - 1);
_multipart_form_name.remove(_multipart_form_name.size() - 1);
_multipart_form_name.remove(_multipart_form_name.length() - 1);
}
} else if (kk == "filename") {
_multipart_form_filename = vs.get_slicec('=', 1);
Expand All @@ -204,8 +203,7 @@ void HTTPParser::_process_multipart_header_value(const String &val) {

if (_multipart_form_name.length() >= 2 && _multipart_form_name.begins_with("\"") && _multipart_form_name.ends_with("\"")) {
_multipart_form_name.remove(0);
//TODO check if this should be _multipart_form_name.remove(_multipart_form_name.length() - 1);
_multipart_form_name.remove(_multipart_form_name.size() - 1);
_multipart_form_name.remove(_multipart_form_name.length() - 1);
}

if (upload_file_store_type == WebServerSimple::FILE_UPLOAD_STORE_TYPE_TEMP_FILES) {
Expand Down

0 comments on commit 75e8f68

Please sign in to comment.