diff --git a/src/main/java/gwangjang/server/global/filter/AuthorizationHeaderFilter.java b/src/main/java/gwangjang/server/global/filter/AuthorizationHeaderFilter.java index 2519fe8..68006c8 100644 --- a/src/main/java/gwangjang/server/global/filter/AuthorizationHeaderFilter.java +++ b/src/main/java/gwangjang/server/global/filter/AuthorizationHeaderFilter.java @@ -55,7 +55,13 @@ public GatewayFilter apply(Config config) { HttpHeaders headers = request.getHeaders(); if (!headers.containsKey(HttpHeaders.AUTHORIZATION)) { - return onError(exchange, NoSuchFieldException.class); +// return onError(exchange, NoSuchFieldException.class); +// headers.add("Authorization","guest"); + ServerHttpRequest newRequest = request.mutate() + .header("user-id", "guest") + .build(); + return chain.filter(exchange.mutate().request(newRequest).build()); + } String authorizationHeader = headers.get(HttpHeaders.AUTHORIZATION).get(0);