From 97b077819a8388a9ed07b75bef4f4ecbf55aade0 Mon Sep 17 00:00:00 2001 From: Eugene Date: Tue, 19 Mar 2019 20:09:53 -0400 Subject: [PATCH] Japscan: use proper request method in interceptor (fixes #931) (#944) Japscan: use proper request method in interceptor (fixes #931) --- src/fr/japscan/build.gradle | 4 +-- .../tachiyomi/extension/fr/japscan/Japscan.kt | 26 ++++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/fr/japscan/build.gradle b/src/fr/japscan/build.gradle index 4f6e3c7bb..5b200fbb0 100644 --- a/src/fr/japscan/build.gradle +++ b/src/fr/japscan/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Japscan' pkgNameSuffix = 'fr.japscan' extClass = '.Japscan' - extVersionCode = 8 + extVersionCode = 9 libVersion = '1.2' } @@ -14,4 +14,4 @@ apply from: "$rootDir/common.gradle" dependencies { implementation 'com.google.code.gson:gson:2.8.5' implementation 'org.apache.commons:commons-lang3:3.8.1' -} \ No newline at end of file +} diff --git a/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt b/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt index e0bb7ed40..476e9715f 100644 --- a/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt +++ b/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt @@ -1,12 +1,5 @@ package eu.kanade.tachiyomi.extension.fr.japscan -/** - * @file Japscan.kt - * @brief Defines class Japscan for french source Japscan - * @date 2018-09-02 - * @version 1.0 - */ - import android.graphics.Bitmap import android.graphics.BitmapFactory import android.graphics.Canvas @@ -15,9 +8,18 @@ import com.google.gson.JsonObject import com.google.gson.JsonParser import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST -import eu.kanade.tachiyomi.source.model.* +import eu.kanade.tachiyomi.source.model.FilterList +import eu.kanade.tachiyomi.source.model.MangasPage +import eu.kanade.tachiyomi.source.model.Page +import eu.kanade.tachiyomi.source.model.SChapter +import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.ParsedHttpSource -import okhttp3.* +import okhttp3.FormBody +import okhttp3.MediaType +import okhttp3.OkHttpClient +import okhttp3.Request +import okhttp3.Response +import okhttp3.ResponseBody import org.apache.commons.lang3.StringUtils import org.jsoup.nodes.Document import org.jsoup.nodes.Element @@ -43,7 +45,11 @@ class Japscan : ParsedHttpSource() { val request = chain.request() val url = request.url().toString() - val response = chain.proceed(GET(url.substringBefore(indicator))) + + val newRequest = request.newBuilder() + .url(url.substringBefore(indicator)) + .build() + val response = chain.proceed(newRequest) if (!url.endsWith(indicator)) return@addInterceptor response