comparison 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
comparison
equal deleted inserted replaced
3398:4acd1431e603 3399:4e8205871967
203 { 203 {
204 throw OrthancException(ErrorCode_NetworkProtocol, 204 throw OrthancException(ErrorCode_NetworkProtocol,
205 "No endline at the end of a part"); 205 "No endline at the end of a part");
206 } 206 }
207 207
208 handler_->Apply(headers, headersMatcher_.GetPointerEnd(), contentLength); 208 handler_->HandlePart(headers, headersMatcher_.GetPointerEnd(), contentLength);
209 current = headersMatcher_.GetMatchEnd() + contentLength + 2; 209 current = headersMatcher_.GetMatchEnd() + contentLength + 2;
210 } 210 }
211 211
212 if (current != corpusEnd) 212 if (current != corpusEnd)
213 { 213 {
291 return true; 291 return true;
292 } 292 }
293 } 293 }
294 294
295 295
296 bool MultipartStreamReader::ParseMultipartHeaders(std::string& contentType, 296 bool MultipartStreamReader::ParseMultipartContentType(std::string& contentType,
297 std::string& subType, 297 std::string& subType,
298 std::string& boundary, 298 std::string& boundary,
299 const HttpHeaders& headers) 299 const std::string& contentTypeHeader)
300 { 300 {
301 std::string tmp;
302 if (!GetMainContentType(tmp, headers))
303 {
304 return false;
305 }
306
307 std::vector<std::string> tokens; 301 std::vector<std::string> tokens;
308 Orthanc::Toolbox::TokenizeString(tokens, tmp, ';'); 302 Orthanc::Toolbox::TokenizeString(tokens, contentTypeHeader, ';');
309 303
310 if (tokens.empty()) 304 if (tokens.empty())
311 { 305 {
312 return false; 306 return false;
313 } 307 }