dev add utf encoding
Test Workflow / test (push) Successful in 3s

This commit is contained in:
vladp
2026-02-10 12:33:07 +07:00
parent 8103960b45
commit e7e870ee30
3 changed files with 43 additions and 2 deletions
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import java.time.LocalDate;
import java.time.LocalDateTime;
@@ -20,7 +21,13 @@ public class JacksonConfig {
@Bean
@Primary
public ObjectMapper objectMapper() {
ObjectMapper mapper = new ObjectMapper();
ObjectMapper mapper = Jackson2ObjectMapperBuilder.json()
.defaultViewInclusion(true)
.autoDetectFields(true)
.failOnUnknownProperties(false)
.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.featuresToEnable(SerializationFeature.INDENT_OUTPUT)
.build();
JavaTimeModule javaTimeModule = new JavaTimeModule();
@@ -0,0 +1,24 @@
package ru.soune.nocopy.configuration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.filter.CharacterEncodingFilter;
@Configuration
public class WebConfig {
@Bean
public FilterRegistrationBean<CharacterEncodingFilter> characterEncodingFilter() {
FilterRegistrationBean<CharacterEncodingFilter> filterRegBean = new FilterRegistrationBean<>();
CharacterEncodingFilter filter = new CharacterEncodingFilter();
filter.setEncoding("UTF-8");
filter.setForceEncoding(true);
filterRegBean.setFilter(filter);
filterRegBean.addUrlPatterns("/*");
filterRegBean.setOrder(Ordered.HIGHEST_PRECEDENCE);
return filterRegBean;
}
}
+11 -1
View File
@@ -72,6 +72,15 @@ security:
server:
port: ${SERVER_PORT:8080}
baseurl: "http://92.242.61.23"
tomcat:
uri-encoding: UTF-8
servlet:
encoding:
charset: UTF-8
enabled: true
force: true
force-request: true
force-response: true
logging:
level:
@@ -128,4 +137,5 @@ tarif:
enterprice-price: 400
enterprice-max-files-count: 50
enterprice-disk-size: 500
enterprice-user-count: 80
enterprice-user-count: 80