diff --git a/package-search-api-models b/package-search-api-models index 575d7e63..aa00d675 160000 --- a/package-search-api-models +++ b/package-search-api-models @@ -1 +1 @@ -Subproject commit 575d7e63635b1a24b75064ec8d723f447ae567dc +Subproject commit aa00d67522436bf4ae38707b0d3fdcc04698ab7e diff --git a/plugin/src/main/kotlin/com/jetbrains/packagesearch/plugin/services/PackageSearchApplicationCachesService.kt b/plugin/src/main/kotlin/com/jetbrains/packagesearch/plugin/services/PackageSearchApplicationCachesService.kt index af6645be..25b25134 100644 --- a/plugin/src/main/kotlin/com/jetbrains/packagesearch/plugin/services/PackageSearchApplicationCachesService.kt +++ b/plugin/src/main/kotlin/com/jetbrains/packagesearch/plugin/services/PackageSearchApplicationCachesService.kt @@ -6,12 +6,15 @@ import com.intellij.ide.actions.cache.AsyncRecoveryResult import com.intellij.ide.actions.cache.RecoveryAction import com.intellij.ide.actions.cache.RecoveryScope import com.intellij.openapi.Disposable +import com.intellij.openapi.application.ApplicationInfo import com.intellij.openapi.application.appSystemDir import com.intellij.openapi.components.Service import com.intellij.openapi.components.Service.Level +import com.intellij.openapi.components.service import com.jetbrains.packagesearch.plugin.PackageSearchBundle import com.jetbrains.packagesearch.plugin.core.PackageSearch import com.jetbrains.packagesearch.plugin.core.nitrite.buildDefaultNitrate +import com.jetbrains.packagesearch.plugin.core.utils.IntelliJApplication import com.jetbrains.packagesearch.plugin.core.utils.PKGSInternalAPI import com.jetbrains.packagesearch.plugin.utils.ApiPackageCacheEntry import com.jetbrains.packagesearch.plugin.utils.ApiRepositoryCacheEntry @@ -20,8 +23,10 @@ import com.jetbrains.packagesearch.plugin.utils.KtorDebugLogger import com.jetbrains.packagesearch.plugin.utils.PackageSearchApiPackageCache import com.jetbrains.packagesearch.plugin.utils.PackageSearchProjectService import io.ktor.client.engine.java.Java +import io.ktor.client.plugins.DefaultRequest import io.ktor.client.plugins.logging.LogLevel import io.ktor.client.plugins.logging.Logging +import io.ktor.http.headers import java.util.concurrent.CompletableFuture import kotlin.io.path.absolutePathString import kotlin.io.path.div @@ -76,6 +81,12 @@ class PackageSearchApplicationCachesService(private val coroutineScope: Coroutin logger = KtorDebugLogger() filter { it.attributes.getOrNull(PackageSearchApiClient.Attributes.Cache) == true } } + install(DefaultRequest) { + headers { + append("JB-Plugin-Version", PackageSearch.pluginVersion) + append("JB-IDE-Version", IntelliJApplication.service().strictVersion) + } + } } )