Skip to content

Commit 486cc11

Browse files
author
oleksiys
committed
[1.8.x] + fix issue AsyncHttpClient#631
AsyncHttpClient#631 "Grizzly provider aggressively set cookie missing domain and path to /"
1 parent 765d400 commit 486cc11

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,15 +1096,8 @@ private void convertCookies(final Collection<Cookie> cookies,
10961096
final org.glassfish.grizzly.http.Cookie[] gCookies) {
10971097
int idx = 0;
10981098
for (final Cookie cookie : cookies) {
1099-
final org.glassfish.grizzly.http.Cookie gCookie =
1100-
new org.glassfish.grizzly.http.Cookie(cookie.getName(), cookie.getValue());
1101-
gCookie.setDomain(cookie.getDomain());
1102-
gCookie.setPath(cookie.getPath());
1103-
gCookie.setVersion(1);
1104-
gCookie.setMaxAge(cookie.getMaxAge());
1105-
gCookie.setSecure(cookie.isSecure());
1106-
gCookies[idx] = gCookie;
1107-
idx++;
1099+
gCookies[idx++] = new org.glassfish.grizzly.http.Cookie(
1100+
cookie.getName(), cookie.getValue());
11081101
}
11091102

11101103
}
@@ -1326,7 +1319,7 @@ protected void onInitialLineParsed(HttpHeader httpHeader,
13261319
try {
13271320
context.result(handler.onCompleted());
13281321
context.done();
1329-
} catch (Exception e) {
1322+
} catch (Throwable e) {
13301323
context.abort(e);
13311324
}
13321325
}
@@ -1459,7 +1452,7 @@ protected void onHttpHeadersParsed(HttpHeader httpHeader,
14591452
"WebSocket protocol error: unexpected HTTP response status during handshake.");
14601453
context.result(null);
14611454
}
1462-
} catch (Exception e) {
1455+
} catch (Throwable e) {
14631456
httpHeader.setSkipRemainder(true);
14641457
context.abort(e);
14651458
}
@@ -1531,7 +1524,7 @@ protected boolean onHttpPacketParsed(HttpHeader httpHeader, FilterChainContext c
15311524
if (handler != null) {
15321525
try {
15331526
context.result(handler.onCompleted());
1534-
} catch (Exception e) {
1527+
} catch (Throwable e) {
15351528
context.abort(e);
15361529
}
15371530
} else {

src/test/java/com/ning/http/client/async/grizzly/GrizzlyAsyncProviderBasicTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012 Sonatype, Inc. All rights reserved.
2+
* Copyright (c) 2012-2014 Sonatype, Inc. All rights reserved.
33
*
44
* This program is licensed to you under the Apache License Version 2.0,
55
* and you may not use this file except in compliance with the Apache License Version 2.0.
@@ -57,9 +57,4 @@ public void customize(TCPNIOTransport transport, FilterChainBuilder builder) {
5757
@Test(groups = { "standalone", "default_provider", "async" }, enabled = false)
5858
public void asyncDoPostBasicGZIPTest() throws Throwable {
5959
}
60-
61-
@Test(groups = { "standalone", "default_provider", "async" }, enabled = false)
62-
public void asyncDoGetCookieTest() throws Throwable {
63-
// FIXME server replies with a foo=bar cookie and yet Grizzly decodes it into foo=value; domain=/; path=/
64-
}
6560
}

0 commit comments

Comments
 (0)