Skip to content

Commit 815b7a2

Browse files
author
oleksiys
committed
[1.8.x] + fix issue AsyncHttpClient#1691
https://java.net/jira/browse/GRIZZLY-1691 "Support RFC 7238, HTTP Status Code "308 Permanent Redirect""
1 parent 4845ce2 commit 815b7a2

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@
591591
<compiler.exclude>com/ning/http/client/providers/grizzly/*.java</compiler.exclude>
592592
<test.compiler.exclude>com/ning/http/client/async/grizzly/*.java</test.compiler.exclude>
593593
<javadoc.package.exclude>com.ning.http.client.providers.grizzly</javadoc.package.exclude>
594-
<grizzly.version>2.3.13</grizzly.version>
594+
<grizzly.version>2.3.14</grizzly.version>
595595
<source.property>1.5</source.property>
596596
<target.property>1.5</target.property>
597597
<surefire.version>2.12</surefire.version>

src/main/java/com/ning/http/client/providers/grizzly/GrizzlyAsyncHttpProvider.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,8 @@ private void addQueryString(final Request request,
11271127

11281128
private static final class AsyncHttpClientEventFilter extends HttpClientFilter {
11291129

1130-
private final Map<Integer,StatusHandler> HANDLER_MAP = new HashMap<Integer,StatusHandler>();
1130+
private final Map<Integer, StatusHandler> HANDLER_MAP =
1131+
new HashMap<Integer, StatusHandler>();
11311132

11321133

11331134
private final GrizzlyAsyncHttpProvider provider;
@@ -1145,8 +1146,12 @@ private static final class AsyncHttpClientEventFilter extends HttpClientFilter {
11451146
RedirectHandler.INSTANCE);
11461147
HANDLER_MAP.put(HttpStatus.FOUND_302.getStatusCode(),
11471148
RedirectHandler.INSTANCE);
1149+
HANDLER_MAP.put(HttpStatus.SEE_OTHER_303.getStatusCode(),
1150+
RedirectHandler.INSTANCE);
11481151
HANDLER_MAP.put(HttpStatus.TEMPORARY_REDIRECT_307.getStatusCode(),
11491152
RedirectHandler.INSTANCE);
1153+
HANDLER_MAP.put(HttpStatus.PERMANENT_REDIRECT_308.getStatusCode(),
1154+
RedirectHandler.INSTANCE);
11501155

11511156
}
11521157

@@ -1557,7 +1562,8 @@ private static boolean isRedirect(final int status) {
15571562
return HttpStatus.MOVED_PERMANENTLY_301.statusMatches(status)
15581563
|| HttpStatus.FOUND_302.statusMatches(status)
15591564
|| HttpStatus.SEE_OTHER_303.statusMatches(status)
1560-
|| HttpStatus.TEMPORARY_REDIRECT_307.statusMatches(status);
1565+
|| HttpStatus.TEMPORARY_REDIRECT_307.statusMatches(status)
1566+
|| HttpStatus.PERMANENT_REDIRECT_308.statusMatches(status);
15611567

15621568
}
15631569

0 commit comments

Comments
 (0)