This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new e4f45e7e5d Fix back-port
e4f45e7e5d is described below

commit e4f45e7e5d74b4f5fdcc46eddeb45a32438ac51f
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jan 7 15:48:34 2026 +0000

    Fix back-port
---
 java/org/apache/catalina/webresources/CachedResource.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/webresources/CachedResource.java 
b/java/org/apache/catalina/webresources/CachedResource.java
index 0aab603b92..e8857fd723 100644
--- a/java/org/apache/catalina/webresources/CachedResource.java
+++ b/java/org/apache/catalina/webresources/CachedResource.java
@@ -662,7 +662,7 @@ public class CachedResource implements WebResource {
         @Override
         public String getContentType() {
             // "content/unknown" is the value used by 
sun.net.www.URLConnection. It is used here for consistency.
-            return Objects.requireNonNullElse(getResource().getMimeType(), 
"content/unknown");
+            return (getResource().getMimeType() != null) ? 
getResource().getMimeType() : "content/unknown";
         }
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to