Skip to content

Commit

Permalink
fix: Resource versioning content strategy (#238)
Browse files Browse the repository at this point in the history
- Add workaround for issue spring-projects/spring-boot#14897
  • Loading branch information
iamareebjamal authored Oct 19, 2018
1 parent 66f1f7b commit 7414f2c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#### v2.0.2 (unreleased):

- No changes
- Add workaround for issue https://github.com/spring-projects/spring-boot/issues/14897 re-enabling resource versioning

#### v2.0.1 (18-10-2018):

Expand Down
14 changes: 14 additions & 0 deletions src/main/java/amu/zhcet/CoreApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.datatables.repository.DataTablesRepositoryFactoryBean;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.web.servlet.resource.ResourceUrlEncodingFilter;

import javax.servlet.DispatcherType;

@SpringBootApplication
@EnableJpaRepositories(repositoryFactoryBeanClass = DataTablesRepositoryFactoryBean.class)
Expand All @@ -22,4 +27,13 @@ public static void main(String[] args) {
SpringApplication.run(CoreApplication.class, args);
}

// Workaround of issue https://github.com/spring-projects/spring-boot/issues/14897
// Remove when fix is released
@Bean
public FilterRegistrationBean<ResourceUrlEncodingFilter> resourceUrlEncodingFilter() {
FilterRegistrationBean<ResourceUrlEncodingFilter> registration = new FilterRegistrationBean<>(new ResourceUrlEncodingFilter());
registration.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.ERROR);
return registration;
}

}

0 comments on commit 7414f2c

Please sign in to comment.