Skip to content

Commit 5f94354

Browse files
authored
Merge pull request #181 from alazeprt/stable/v3
feat(plugin): 添加在远程获取头颅信息时的连接/读取超时设置
2 parents eeb2a40 + 7a15f45 commit 5f94354

File tree

1 file changed

+2
-0
lines changed
  • plugin/src/main/kotlin/trplugins/menu/util/bukkit

1 file changed

+2
-0
lines changed

plugin/src/main/kotlin/trplugins/menu/util/bukkit/Heads.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ object Heads {
150150
try {
151151
val con = URL(url).openConnection()
152152
// Java 8 require user agent
153+
con.connectTimeout = 500
154+
con.readTimeout = 2500
153155
con.addRequestProperty("User-Agent", "Mozilla/5.0")
154156
con.getInputStream().use { `in` ->
155157
BufferedReader(InputStreamReader(`in`)).use { reader ->

0 commit comments

Comments
 (0)