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 @@ -1100,6 +1100,12 @@ public HermesClient forProfile(ProfileBinding binding) {
11001100 if (!isHttpEnabled ()) {
11011101 throw new IllegalStateException ("Hermes HTTP client is disabled" );
11021102 }
1103+ if (ownedHttpClient == null
1104+ && (!sharedHttpClient .interceptors ().isEmpty ()
1105+ || !sharedHttpClient .networkInterceptors ().isEmpty ())) {
1106+ throw new IllegalStateException (
1107+ "Cannot prove profile isolation for an externally managed OkHttpClient with interceptors" );
1108+ }
11031109 String profileId = normalizeProfileId (binding .getProfileId ());
11041110 String cacheKey = config .getHttp ().getBaseUrl () + "|" + profileId + "|" + binding .getCredentialIdentity ();
11051111 return profileClients .computeIfAbsent (cacheKey , ignored -> createProfileClient (binding , profileId ));
You can’t perform that action at this time.
0 commit comments