diff -r 09b6511e84f4 Plugin/WadoRs.cpp --- a/Plugin/WadoRs.cpp Tue Aug 27 15:53:55 2019 +0200 +++ b/Plugin/WadoRs.cpp Thu Aug 29 22:57:47 2019 -0400 @@ -25,7 +25,7 @@ #include #include #include - +#include #include @@ -116,11 +116,23 @@ std::map attributes; OrthancPlugins::ParseContentType(application, attributes, accept); - if (application == "application/json" || - application == "application/dicom+json" || - application == "*/*") + std::vector accept_tokens; + Orthanc::Toolbox::TokenizeString(accept_tokens, application, ',') ; + + if(accept_tokens.size() == 0) + accept_tokens.push_back(application); + + for (size_t i = accept_tokens.size()-1; i >= 0; i-- ) { - return true; + application = accept_tokens[i]; + boost::algorithm::trim(application) ; + + if (application == "application/json" || + application == "application/dicom+json" || + application == "*/*") + { + return true; + } } if (application != "multipart/related")