feat(customer-apigateway): 알림 서비스 cors 등록, exception handler 변경
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user