Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand All @@ -27,20 +27,20 @@ To add this library to your project, you can include this dependency in your Mav
<dependency>
<groupId>io.fusionauth</groupId>
<artifactId>java-http</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
</dependency>
```

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:
Expand Down
2 changes: 1 addition & 1 deletion build.savant
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.fusionauth</groupId>
<artifactId>java-http</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
<packaging>jar</packaging>

<name>Java HTTP library (client and server)</name>
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/io/fusionauth/http/Cookie.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/fusionauth/http/ChunkedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
12 changes: 12 additions & 0 deletions src/test/java/io/fusionauth/http/CookieTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down