Skip to content

Commit

Permalink
Merge pull request #62 from Project-Catcher/chore-dj-swagger-config
Browse files Browse the repository at this point in the history
test: swagger 설정 위해 proxy header 추가
  • Loading branch information
pingu9 authored Dec 10, 2023
2 parents f86d583 + c724e37 commit 64fc80e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/main/java/com/catcher/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.catcher.config;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.ForwardedHeaderFilter;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

Expand All @@ -16,4 +18,9 @@ public class WebConfig implements WebMvcConfigurer {
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
resolvers.addAll(resolverList);
}

@Bean
ForwardedHeaderFilter forwardedHeaderFilter() {
return new ForwardedHeaderFilter();
}
}
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ spring.datasource.driver-class-name=org.mariadb.jdbc.Driver

### swagger
springdoc.api-docs.path=/core/v3/api-docs
springdoc.swagger-ui.config-url=/core/v3/api-docs/swagger-config
springdoc.swagger-ui.config-url=/core/v3/api-docs/swagger-config
server.forward-headers-strategy=framework

0 comments on commit 64fc80e

Please sign in to comment.