File tree Expand file tree Collapse file tree
src/main/java/io/github/easy4j/hermes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1103,6 +1103,12 @@ public HermesClient forProfile(ProfileBinding binding) {
11031103 if (!isHttpEnabled ()) {
11041104 throw new IllegalStateException ("Hermes HTTP client is disabled" );
11051105 }
1106+ if (ownedHttpClient == null
1107+ && (!sharedHttpClient .interceptors ().isEmpty ()
1108+ || !sharedHttpClient .networkInterceptors ().isEmpty ())) {
1109+ throw new IllegalStateException (
1110+ "Cannot prove profile isolation for an externally managed OkHttpClient with interceptors" );
1111+ }
11061112 String profileId = normalizeProfileId (binding .getProfileId ());
11071113 String cacheKey = config .getHttp ().getBaseUrl () + "|" + profileId + "|" + binding .getCredentialIdentity ();
11081114 return profileClients .computeIfAbsent (cacheKey , ignored -> createProfileClient (binding , profileId ));
You can’t perform that action at this time.
0 commit comments