You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by GitBox <gi...@apache.org> on 2021/04/24 19:43:24 UTC

[GitHub] [maven-site-plugin] elharo commented on a change in pull request #48: [MSITE-872] Set the Content-Type header

elharo commented on a change in pull request #48:
URL: https://github.com/apache/maven-site-plugin/pull/48#discussion_r619700755



##########
File path: src/main/java/org/apache/maven/plugins/site/run/DoxiaFilter.java
##########
@@ -114,6 +116,8 @@ public void doFilter( ServletRequest servletRequest, ServletResponse servletResp
                 path = path.substring( languageWanted.length() + 1 );
             }
         }
+        // Set the contentType for the response
+        servletResponse.setContentType( Files.probeContentType( ( new File ( path ) ).toPath( ) ) );

Review comment:
       this method can return null




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org