User-Agent

This commit is contained in:
tom5079
2022-01-03 00:00:37 +09:00
parent 1b441f6aea
commit c5fd674020
3 changed files with 7 additions and 3 deletions

View File

@@ -109,7 +109,11 @@ class Pupil : Application() {
.readTimeout(0, TimeUnit.SECONDS)
.proxyInfo(proxyInfo)
.addInterceptor { chain ->
val request = chain.request()
val request = chain.request().newBuilder()
.header("User-Agent","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) " +
"Ubuntu Chromium/70.0.3538.77 Chrome/70.0.3538.77 Safari/537.36")
.build()
val tag = request.tag() ?: return@addInterceptor chain.proceed(request)
interceptors[tag::class]?.invoke(chain) ?: chain.proceed(request)