From d21674634d5631b7f6efb1624e1ef4a9b69a7f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCngener?= Date: Fri, 29 Mar 2019 16:11:17 +0100 Subject: [PATCH] Update LocationRewriteFilter.java --- .../cloud/netflix/zuul/filters/post/LocationRewriteFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-cloud-netflix-zuul/src/main/java/org/springframework/cloud/netflix/zuul/filters/post/LocationRewriteFilter.java b/spring-cloud-netflix-zuul/src/main/java/org/springframework/cloud/netflix/zuul/filters/post/LocationRewriteFilter.java index 31c1c7abee..6155838fcb 100644 --- a/spring-cloud-netflix-zuul/src/main/java/org/springframework/cloud/netflix/zuul/filters/post/LocationRewriteFilter.java +++ b/spring-cloud-netflix-zuul/src/main/java/org/springframework/cloud/netflix/zuul/filters/post/LocationRewriteFilter.java @@ -76,7 +76,8 @@ public int filterOrder() { public boolean shouldFilter() { RequestContext ctx = RequestContext.getCurrentContext(); int statusCode = ctx.getResponseStatusCode(); - return HttpStatus.valueOf(statusCode).is3xxRedirection(); + HttpStatus resolve = HttpStatus.resolve(statusCode); + return resolve!=null && resolve.is3xxRedirection(); } @Override