felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1715385 - /felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
Date Fri, 20 Nov 2015 16:20:21 GMT
Author: cziegeler
Date: Fri Nov 20 16:20:21 2015
New Revision: 1715385

URL: http://svn.apache.org/viewvc?rev=1715385&view=rev
Log:
FELIX-5110 : HTTP resources content type are not set when using whiteboard pattern. Apply
patch from Xavier Fournet

Modified:
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java?rev=1715385&r1=1715384&r2=1715385&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
Fri Nov 20 16:20:21 2015
@@ -44,6 +44,7 @@ import javax.servlet.http.HttpSessionLis
 
 import org.apache.felix.http.base.internal.context.ExtServletContext;
 import org.apache.felix.http.base.internal.registry.EventListenerRegistry;
+import org.apache.felix.http.base.internal.util.MimeTypes;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.wiring.BundleWiring;
 import org.osgi.service.http.context.ServletContextHelper;
@@ -122,7 +123,12 @@ public class PerBundleServletContextImpl
     @Override
     public String getMimeType(final String name)
     {
-        return this.contextHelper.getMimeType(name);
+        String type = this.contextHelper.getMimeType(name);
+        if (type != null) {
+            return type;
+        }
+
+        return MimeTypes.get().getByFile(name);
     }
 
     @Override



Mime
View raw message