diff Core/HttpServer/EmbeddedResourceHttpHandler.cpp @ 2908:9d277f8ad698

new enumeration: MimeType
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 30 Oct 2018 16:16:07 +0100
parents 2a504fef4ed7
children 4e43e67f8ecf
line wrap: on
line diff
--- a/Core/HttpServer/EmbeddedResourceHttpHandler.cpp	Tue Oct 30 13:53:29 2018 +0100
+++ b/Core/HttpServer/EmbeddedResourceHttpHandler.cpp	Tue Oct 30 16:16:07 2018 +0100
@@ -78,14 +78,14 @@
     }
 
     std::string resourcePath = Toolbox::FlattenUri(uri, baseUri_.size());
-    std::string contentType = SystemToolbox::AutodetectMimeType(resourcePath);
+    MimeType contentType = SystemToolbox::AutodetectMimeType(resourcePath);
 
     try
     {
       const void* buffer = EmbeddedResources::GetDirectoryResourceBuffer(resourceId_, resourcePath.c_str());
       size_t size = EmbeddedResources::GetDirectoryResourceSize(resourceId_, resourcePath.c_str());
 
-      output.SetContentType(contentType.c_str());
+      output.SetContentType(contentType);
       output.Answer(buffer, size);
     }
     catch (OrthancException&)