Skip to content

Commit

Permalink
241 - Add UserAgent to Ktor client and remove GITHUB_REF from run set…
Browse files Browse the repository at this point in the history
…tings (#177)

The commit introduces a new UserAgent to the Ktor client within the PackageSearchApplicationCachesService.kt for the IntelliJApplication. The UserAgent is set using fullApplicationName coming from the service ApplicationInfo. On a different note, an unused environment variable GITHUB_REF has been removed from the Plugin.run.xml configuration file, for cleanup purposes.
  • Loading branch information
lamba92 authored May 23, 2024
1 parent 9bf2c45 commit 824896b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion .run/[KMP] Package Search Plugin.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<ExternalSystemSettings>
<option name="env">
<map>
<entry key="GITHUB_REF" value="refs/tags/241.0.10" />
<entry key="KMP" value="true" />
</map>
</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.jetbrains.packagesearch.plugin.utils.PackageSearchLogger
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.UserAgent
import io.ktor.client.plugins.logging.LogLevel
import io.ktor.client.plugins.logging.Logging
import io.ktor.client.request.headers
Expand Down Expand Up @@ -98,6 +99,9 @@ class PackageSearchApplicationCachesService(private val coroutineScope: Coroutin
append("JB-IDE-Version", IntelliJApplication.service<ApplicationInfo>().strictVersion)
}
}
install(UserAgent) {
agent = IntelliJApplication.service<ApplicationInfo>().fullApplicationName
}
}
)

Expand Down

0 comments on commit 824896b

Please sign in to comment.