I’m extending the HTTP Client plugin (as an optional dependency, of course) as follows:
<extensions defaultExtensionNs="com.intellij.httpClient">
<requestExecutionSupport
implementation="com.illuminatedcloud.intellij.restClient.IlluminatedCloudConnectionRequestExecutionSupport"/>
</extensions>
and:
public class IlluminatedCloudConnectionRequestExecutionSupport extends HttpRequestRunSupport {
@Override
@NotNull
public HttpRequestConverter getRequestConverter() {
return new HttpRequestConverter() {
@Override
@Nullable
public Object prepareRequestForExecution(
@NotNull RestClientRequest request,
@NotNull Continuation<? super RestClientRequest> continuation
) {
addAuthorizationHeader(request);
return super.prepareRequestForExecution(request, continuation);
}
};
}
private void addAuthorizationHeader(@NotNull RestClientRequest request) {
// Adds an Authorization header if appropriate based on the requested URL
}
}
Everything works just fine, but I’m seeing the following in idea.log
corresponding to these requests:
2025-04-15 16:12:51,522 [ 39317] SEVERE - #c.i.h.e.c.RequestExecutionSupport - Assertion failed: Ambiguous context RequestContext(method=GET, debugMode=false, scheme=https), too many suitable execution supports: [com.illuminatedcloud.intellij.restClient.IlluminatedCloudConnectionRequestExecutionSupport, com.intellij.httpClient.execution.impl.HttpRequestRunSupport]
java.lang.Throwable: Assertion failed: Ambiguous context RequestContext(method=GET, debugMode=false, scheme=https), too many suitable execution supports: [com.illuminatedcloud.intellij.restClient.IlluminatedCloudConnectionRequestExecutionSupport, com.intellij.httpClient.execution.impl.HttpRequestRunSupport]
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:469)
at com.intellij.httpClient.execution.common.RequestExecutionSupport$All.forContext(RequestExecutionSupport.kt:57)
at com.intellij.httpClient.execution.impl.RequestExecutionHelperKt.tryExecuteRequest(RequestExecutionHelper.kt:28)
at com.intellij.httpClient.execution.RestClientControllerImpl$executeRequest$1.invokeSuspend(RestClientControllerImpl.kt:53)
Obviously source code is not available for the com.intellij.httpClient
package, so I don’t know what I need to do differently to address these logged failed assertions. Any thoughts?