From 931901bd67031b7e42083f0027afde6848c70a6e Mon Sep 17 00:00:00 2001 From: byeolhaha Date: Fri, 15 Dec 2023 15:44:51 +0900 Subject: [PATCH] =?UTF-8?q?Style=20:=20=EC=84=A4=EC=A0=95=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/guzzing/studayserver/global/config/WebConfig.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/guzzing/studayserver/global/config/WebConfig.java b/src/main/java/org/guzzing/studayserver/global/config/WebConfig.java index 0fe4de26..bcf85446 100644 --- a/src/main/java/org/guzzing/studayserver/global/config/WebConfig.java +++ b/src/main/java/org/guzzing/studayserver/global/config/WebConfig.java @@ -1,23 +1,22 @@ package org.guzzing.studayserver.global.config; +import jakarta.annotation.PostConstruct; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.filter.ShallowEtagHeaderFilter; import org.springframework.web.servlet.HandlerInterceptor; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -@EnableWebMvc @Configuration public class WebConfig implements WebMvcConfigurer { @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new HandlerInterceptor() { @Override + @PostConstruct public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if(request.getMethod().equals("GET")) { response.setHeader("Cache-Control","no-cache");