-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: possible content convert exception
- Loading branch information
Showing
3 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...eptor-ktor/lib-no-op/src/main/java/com/pluto/plugins/network/ktor/PlutoKtorInterceptor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
package com.pluto.plugins.network.ktor | ||
|
||
import io.ktor.client.HttpClient | ||
import io.ktor.client.plugins.HttpClientPlugin | ||
import io.ktor.util.AttributeKey | ||
|
||
@Deprecated("install the PlutoKtorInterceptor plugin instead") | ||
@SuppressWarnings("EmptyFunctionBlock") | ||
fun HttpClient.addPlutoKtorInterceptor() { | ||
} | ||
|
||
class PlutoKtorInterceptor private constructor() { | ||
companion object : HttpClientPlugin<Unit, PlutoKtorInterceptor> { | ||
override val key: AttributeKey<PlutoKtorInterceptor> | ||
get() = AttributeKey("PlutoKtorInterceptor") | ||
|
||
override fun prepare(block: Unit.() -> Unit): PlutoKtorInterceptor { | ||
return PlutoKtorInterceptor() | ||
} | ||
|
||
override fun install(plugin: PlutoKtorInterceptor, scope: HttpClient) { | ||
// no-op | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters