diff Core/HttpServer/MultipartStreamReader.cpp @ 3399:4e8205871967

OrthancPluginRegisterMultipartRestCallback() is working
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 Jun 2019 14:14:31 +0200
parents 4acd1431e603
children 8de071691d13
line wrap: on
line diff
--- a/Core/HttpServer/MultipartStreamReader.cpp	Fri Jun 07 13:36:43 2019 +0200
+++ b/Core/HttpServer/MultipartStreamReader.cpp	Fri Jun 07 14:14:31 2019 +0200
@@ -205,7 +205,7 @@
                                "No endline at the end of a part");
       }
           
-      handler_->Apply(headers, headersMatcher_.GetPointerEnd(), contentLength);
+      handler_->HandlePart(headers, headersMatcher_.GetPointerEnd(), contentLength);
       current = headersMatcher_.GetMatchEnd() + contentLength + 2;
     }
 
@@ -293,19 +293,13 @@
   }
 
 
-  bool MultipartStreamReader::ParseMultipartHeaders(std::string& contentType,
-                                                    std::string& subType,
-                                                    std::string& boundary,
-                                                    const HttpHeaders& headers)
+  bool MultipartStreamReader::ParseMultipartContentType(std::string& contentType,
+                                                        std::string& subType,
+                                                        std::string& boundary,
+                                                        const std::string& contentTypeHeader)
   {
-    std::string tmp;
-    if (!GetMainContentType(tmp, headers))
-    {
-      return false;
-    }
-
     std::vector<std::string> tokens;
-    Orthanc::Toolbox::TokenizeString(tokens, tmp, ';');
+    Orthanc::Toolbox::TokenizeString(tokens, contentTypeHeader, ';');
 
     if (tokens.empty())
     {