Skip to content

Commit

Permalink
ExposedHeaders header 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
HwangHoYoon committed Jan 23, 2024
1 parent ee0fd5f commit 93a2d64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/chwipoClova/common/config/CorsConfig.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.chwipoClova.common.config;

import com.chwipoClova.common.utils.JwtUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
Expand All @@ -24,7 +26,7 @@ public CorsConfigurationSource corsConfigurationSource() {

config.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
config.setAllowedHeaders(List.of("*"));
config.setExposedHeaders(List.of("*"));
config.setExposedHeaders(List.of("cache-control", "content-length", "content-type", "expires", "pragma", HttpHeaders.SET_COOKIE, JwtUtil.ACCESS_TOKEN));

UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", config);
Expand Down

0 comments on commit 93a2d64

Please sign in to comment.