Skip to content

Commit d9f071d

Browse files
committed
Modified example.md file
1 parent 98c8052 commit d9f071d

1 file changed

Lines changed: 1 addition & 26 deletions

File tree

EXAMPLES.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ JwkProvider provider = new JwkProviderBuilder("https://samples.auth0.com/")
4646

4747
### Configure a custom HTTP client
4848

49-
The `httpClient()` builder method lets you replace the default `java.net.URLConnection`-based HTTP transport with any HTTP library. This solves four common requirements: custom TLS, authenticated proxies, Cache-Control header access, and HTTP/2.
49+
The `httpClient()` builder method lets you replace the default `java.net.URLConnection`-based HTTP transport with any HTTP library. This solves three common requirements: custom TLS, authenticated proxies, and HTTP/2.
5050

5151
> When `httpClient()` is set, `proxied()`, `timeouts()`, and `headers()` are ignored — the custom client has full control over the HTTP layer.
5252
@@ -105,31 +105,6 @@ JwkProvider provider = new JwkProviderBuilder("https://samples.auth0.com/")
105105
.build();
106106
```
107107

108-
#### Cache-Control Headers
109-
110-
Response headers (including `Cache-Control`) are now accessible via `JwksHttpResponse`:
111-
112-
```java
113-
JwksHttpClient headerAwareClient = url -> {
114-
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
115-
conn.setRequestProperty("Accept", "application/json");
116-
try (InputStream in = conn.getInputStream()) {
117-
String body = new String(in.readAllBytes(), StandardCharsets.UTF_8);
118-
JwksHttpResponse response = new JwksHttpResponse(body, conn.getHeaderFields());
119-
120-
// Headers are now available for inspection
121-
String cacheControl = response.getHeaderValue("Cache-Control");
122-
// e.g., "max-age=3600"
123-
124-
return response;
125-
}
126-
};
127-
128-
JwkProvider provider = new JwkProviderBuilder("https://samples.auth0.com/")
129-
.httpClient(headerAwareClient)
130-
.build();
131-
```
132-
133108
#### HTTP/2 Support
134109

135110
**Using Java 11+ HttpClient:**

0 commit comments

Comments
 (0)