[jboss-jira] [JBoss JIRA] (AS7-5200) 128.3.5 Static Content
Tomaz Cerar (JIRA)
jira-events at lists.jboss.org
Fri Apr 5 18:02:41 EDT 2013
[ https://issues.jboss.org/browse/AS7-5200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765368#comment-12765368 ]
Tomaz Cerar commented on AS7-5200:
----------------------------------
Npe is caused by wrongly adding filter to metadata, you just add mapping data and not much more...
code for adding should look something like this:
{code}
FilterMetaData filterMetaData = new FilterMetaData();
filterMetaData.setFilterClass(WebBundleContextFilter.class.getName());
filterMetaData.setFilterName("Filter forbidden resources");
FilterMappingMetaData filterMappingMetaData = new FilterMappingMetaData();
filterMappingMetaData.setFilterName(filterMetaData.getName());
//filterMappingMetaData.setServletNames(Collections.singletonList("io.undertow.DefaultServlet"));
filterMappingMetaData.setUrlPatterns(Arrays.asList("/OSGI-INF/*", "/OSGI-OPT/*"));
JBossWebMetaData jbossWebMetaData = warMetaData.getMergedJBossWebMetaData();
FiltersMetaData filters = jbossWebMetaData.getFilters();
if (filters == null) {
filters = new FiltersMetaData();
jbossWebMetaData.setFilters(filters);
}
filters.add(filterMetaData);
List<FilterMappingMetaData> filterMappings = jbossWebMetaData.getFilterMappings();
if (filterMappings == null) {
filterMappings = new ArrayList<>();
jbossWebMetaData.setFilterMappings(filterMappings);
}
filterMappings.add(filterMappingMetaData);
{code}
i sent PR with the fix: https://github.com/jbossas/jboss-as/pull/4334
but i don't like the part where dependency is added by processor.
I will see what can be done to make this better.
> 128.3.5 Static Content
> ----------------------
>
> Key: AS7-5200
> URL: https://issues.jboss.org/browse/AS7-5200
> Project: Application Server 7
> Issue Type: Sub-task
> Components: OSGi
> Reporter: David Bosschaert
> Assignee: Tomaz Cerar
> Fix For: 8.0.0.Alpha1
>
>
> For confidentiality reasons, a Web Runtime must not return any static content for paths that start with one of the following prefixes:
> WEB-INF/
> OSGI-INF/
> META-INF/
> OSGI-OPT/
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list