Read Mangas: Fix referer encode (#7512)

fix referer encode
This commit is contained in:
Hellkaros 2025-02-06 10:25:08 -03:00 committed by Draff
parent a55bcf4996
commit a622437064
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'Read Mangas' extName = 'Read Mangas'
extClass = '.ReadMangas' extClass = '.ReadMangas'
extVersionCode = 37 extVersionCode = 38
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -23,6 +23,7 @@ import okhttp3.Response
import org.json.JSONObject import org.json.JSONObject
import rx.Observable import rx.Observable
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
import java.net.URLEncoder
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Date import java.util.Date
import java.util.Locale import java.util.Locale
@ -203,8 +204,10 @@ class ReadMangas() : HttpSource() {
.addQueryParameter("input", input.toString()) .addQueryParameter("input", input.toString())
.build() .build()
val encodedUrl = URLEncoder.encode(manga.url.substringBeforeLast("#"), "UTF-8")
val apiHeaders = headers.newBuilder() val apiHeaders = headers.newBuilder()
.set("Referer", "$baseUrl${manga.url.substringBeforeLast("#")}") .set("Referer", "$baseUrl$encodedUrl")
.set("Content-Type", "application/json") .set("Content-Type", "application/json")
.set("Cache-Control", "no-cache") .set("Cache-Control", "no-cache")
.build() .build()