Skip to content

Commit

Permalink
fix(api) : swagger proxy 가능하도록 forward headers framework 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
ImNM committed Jan 8, 2023
1 parent c7e0518 commit 45e7ca5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
import org.springframework.web.filter.ForwardedHeaderFilter;

@RequiredArgsConstructor
@SpringBootApplication
Expand All @@ -21,6 +23,11 @@ public static void main(String[] args) {
SpringApplication.run(DuDoongApiServerApplication.class, args);
}

@Bean
ForwardedHeaderFilter forwardedHeaderFilter() {
return new ForwardedHeaderFilter();
}

@Override
public void onApplicationEvent(ApplicationReadyEvent event) {
log.info("applicationReady status" + Arrays.toString(environment.getActiveProfiles()));
Expand Down
3 changes: 2 additions & 1 deletion DuDoong-Api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ spring:
springdoc:
default-produces-media-type: application/json
default-consumes-media-type: application/json

server:
forward-headers-strategy: framework
---
spring:
config:
Expand Down

0 comments on commit 45e7ca5

Please sign in to comment.