diff --git a/README.md b/README.md index f863532..5022015 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ### Latest versions -* Latest stable version: `1.1.0` +* Latest stable version: `1.1.1` * Now with 100% more virtual threads! * Prior stable version `0.3.7` @@ -27,20 +27,20 @@ To add this library to your project, you can include this dependency in your Mav io.fusionauth java-http - 1.1.0 + 1.1.1 ``` If you are using Gradle, you can add this to your build file: ```groovy -implementation 'io.fusionauth:java-http:1.1.0' +implementation 'io.fusionauth:java-http:1.1.1' ``` If you are using Savant, you can add this to your build file: ```groovy -dependency(id: "io.fusionauth:java-http:1.1.0") +dependency(id: "io.fusionauth:java-http:1.1.1") ``` ## Examples Usages: diff --git a/build.savant b/build.savant index b82df48..dc347fc 100644 --- a/build.savant +++ b/build.savant @@ -18,7 +18,7 @@ restifyVersion = "4.2.1" slf4jVersion = "2.0.17" testngVersion = "7.11.0" -project(group: "io.fusionauth", name: "java-http", version: "1.1.0", licenses: ["ApacheV2_0"]) { +project(group: "io.fusionauth", name: "java-http", version: "1.1.1", licenses: ["ApacheV2_0"]) { workflow { fetch { // Dependency resolution order: diff --git a/pom.xml b/pom.xml index fdb816d..bf0c146 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 io.fusionauth java-http - 1.1.0 + 1.1.1 jar Java HTTP library (client and server) diff --git a/src/main/java/io/fusionauth/http/Cookie.java b/src/main/java/io/fusionauth/http/Cookie.java index b693eec..1fd82c1 100644 --- a/src/main/java/io/fusionauth/http/Cookie.java +++ b/src/main/java/io/fusionauth/http/Cookie.java @@ -290,11 +290,13 @@ public boolean equals(Object o) { } return httpOnly == cookie.httpOnly && secure == cookie.secure && + Objects.equals(attributes, cookie.attributes) && Objects.equals(domain, cookie.domain) && Objects.equals(expires, cookie.expires) && Objects.equals(maxAge, cookie.maxAge) && Objects.equals(name, cookie.name) && Objects.equals(path, cookie.path) && + sameSite == cookie.sameSite && Objects.equals(value, cookie.value); } @@ -364,7 +366,16 @@ public boolean hasAttribute(String name) { @Override public int hashCode() { - return Objects.hash(domain, expires, httpOnly, maxAge, name, path, secure, value); + return Objects.hash(attributes, + domain, + expires, + httpOnly, + maxAge, + name, + path, + sameSite, + secure, + value); } public boolean isHttpOnly() { diff --git a/src/test/java/io/fusionauth/http/ChunkedTest.java b/src/test/java/io/fusionauth/http/ChunkedTest.java index bce5c3a..4a9d297 100644 --- a/src/test/java/io/fusionauth/http/ChunkedTest.java +++ b/src/test/java/io/fusionauth/http/ChunkedTest.java @@ -371,8 +371,8 @@ public void performanceChunked(String scheme) throws Exception { // REST client which does seem to be fairly predictable, but for example, using a REST client that uses HttpURLConnection is much less // predictable, but fast. 😀 // - // If it keeps failing, we could modify this assertion to assert 1 or 2. - assertEquals(instrumenter.getConnections(), 1); + // - Going to call this a pass if we have one or two connections. + assertTrue(instrumenter.getConnections() == 1 || instrumenter.getConnections() == 2); assertEquals(instrumenter.getChunkedResponses(), iterations); assertEquals(instrumenter.getAcceptedRequests(), iterations); } diff --git a/src/test/java/io/fusionauth/http/CookieTest.java b/src/test/java/io/fusionauth/http/CookieTest.java index 4d6103f..538524e 100644 --- a/src/test/java/io/fusionauth/http/CookieTest.java +++ b/src/test/java/io/fusionauth/http/CookieTest.java @@ -309,6 +309,18 @@ public void fromResponseHeader() { cookie = Cookie.fromResponseHeader("=a"); assertNull(cookie); + // Borked coookie, ending with a semicolon; + cookie = Cookie.fromResponseHeader("foo=%2Fbar; Path=/; Secure; HTTPonly;"); + assertNull(cookie.domain); + assertNull(cookie.expires); + assertTrue(cookie.httpOnly); + assertNull(cookie.maxAge); + assertEquals(cookie.name, "foo"); + assertEquals(cookie.path, "/"); + assertNull(cookie.sameSite); + assertTrue(cookie.secure); + assertEquals(cookie.value, "%2Fbar"); + // additional attributes // - name and value cookie = Cookie.fromResponseHeader("foo=;utm=123");