Skip to content

Commit 34a95f0

Browse files
author
oleksiys
committed
[master] + fix issue #631
#631 "Grizzly provider aggressively set cookie missing domain and path to /"
1 parent 399d78c commit 34a95f0

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly/EventHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public void onInitialLineParsed(HttpHeader httpHeader, FilterChainContext ctx) {
185185
try {
186186
context.result(handler.onCompleted());
187187
context.done();
188-
} catch (Exception e) {
188+
} catch (Throwable e) {
189189
context.abort(e);
190190
}
191191
}
@@ -289,7 +289,7 @@ public void onHttpHeadersParsed(HttpHeader httpHeader, FilterChainContext ctx) {
289289
"WebSocket protocol error: unexpected HTTP response status during handshake.");
290290
context.result(null);
291291
}
292-
} catch (Exception e) {
292+
} catch (Throwable e) {
293293
httpHeader.setSkipRemainder(true);
294294
context.abort(e);
295295
}
@@ -341,7 +341,7 @@ public boolean onHttpPacketParsed(HttpHeader httpHeader, FilterChainContext ctx)
341341
if (handler != null) {
342342
try {
343343
context.result(handler.onCompleted());
344-
} catch (Exception e) {
344+
} catch (Throwable e) {
345345
context.abort(e);
346346
}
347347
} else {

providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly/filters/AsyncHttpClientFilter.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -520,17 +520,13 @@ private void addCookies(final Request request, final HttpRequestPacket requestPa
520520
}
521521
}
522522

523-
private static void convertCookies(final Collection<Cookie> cookies, final org.glassfish.grizzly.http.Cookie[] gCookies) {
523+
private static void convertCookies(final Collection<Cookie> cookies,
524+
final org.glassfish.grizzly.http.Cookie[] gCookies) {
524525
int idx = 0;
525526
if (!cookies.isEmpty()) {
526527
for (final Cookie cookie : cookies) {
527-
final org.glassfish.grizzly.http.Cookie gCookie = new org.glassfish.grizzly.http.Cookie(cookie.getName(), cookie.getValue());
528-
gCookie.setDomain(cookie.getDomain());
529-
gCookie.setPath(cookie.getPath());
530-
gCookie.setMaxAge(cookie.getMaxAge());
531-
gCookie.setSecure(cookie.isSecure());
532-
gCookies[idx] = gCookie;
533-
idx++;
528+
gCookies[idx++] = new org.glassfish.grizzly.http.Cookie(
529+
cookie.getName(), cookie.getValue());
534530
}
535531
}
536532
}

0 commit comments

Comments
 (0)