feat(customer-apigateway): 알림 서비스 cors 등록, exception handler 변경

This commit is contained in:
bum12ark
2022-03-10 10:29:49 +09:00
parent b6802702e7
commit 582594ac29
2 changed files with 12 additions and 3 deletions

View File

@@ -44,10 +44,10 @@ public class GlobalExceptionHandler implements ErrorWebExceptionHandler {
exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON);
responseBody.put("code", "INVALID");
responseBody.put("message", "Invalid Access Token");
}else{
exchange.getResponse().setStatusCode(HttpStatus.UNAUTHORIZED);
} else {
exchange.getResponse().setStatusCode(exchange.getResponse().getStatusCode());
exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON);
responseBody.put("code", "INVALID");
responseBody.put("code", ex.getMessage());
}
DataBuffer wrap = null;

View File

@@ -38,6 +38,7 @@ spring:
- PUT
- OPTIONS
- DELETE
- PATCH
allowedHeaders: '*'
allow-credentials: true
routes:
@@ -57,6 +58,14 @@ spring:
- AuthorizationHeaderFilter
- RewritePath=/store-service/(?<segment>.*),/$\{segment}
- id: notification-service
uri: lb://NOTIFICATION-SERVICE
predicates:
- Path=/notification-service/**
filters:
- AuthorizationHeaderFilter
- RewritePath=/notification-service/(?<segment>.*),/$\{segment}
- id: user-service
uri: lb://USER-SERVICE
predicates: