Skip to content

Commit

Permalink
Updates in response to CodeRabbit
Browse files Browse the repository at this point in the history
  • Loading branch information
iain-henderson committed Aug 28, 2023
1 parent 4315cc1 commit 2da31ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 2 additions & 3 deletions core/src/main/java/feign/RedirectionInterceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ public Object aroundDecode(InvocationContext invocationContext) throws Exception
Response response = invocationContext.response();
int status = response.status();
Object returnValue = null;
if (300 <= status && status < 400) {
if (300 <= status && status < 400 && response.headers().containsKey("Location")) {
Type returnType = rawType(invocationContext.returnType());
Collection<String> locations =
response.headers().getOrDefault("Location", Collections.emptyList());
Collection<String> locations = response.headers().get("Location");
if (Collection.class.equals(returnType)) {
returnValue = locations;
} else if (String.class.equals(returnType)) {
Expand Down
8 changes: 6 additions & 2 deletions core/src/test/java/feign/FeignTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
import feign.Feign.ResponseMappingDecoder;
import feign.Request.HttpMethod;
import feign.Target.HardCodedTarget;
import feign.codec.*;
import feign.querymap.BeanQueryMapEncoder;
import feign.codec.DecodeException;
import feign.codec.Decoder;
import feign.codec.EncodeException;
import feign.codec.Encoder;
import feign.codec.ErrorDecoder;
import feign.codec.StringDecoder;import feign.querymap.BeanQueryMapEncoder;
import feign.querymap.FieldQueryMapEncoder;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
Expand Down

0 comments on commit 2da31ac

Please sign in to comment.