diff --git a/app/src/main/java/au/com/joshsharp/wishkobone/APIClient.kt b/app/src/main/java/au/com/joshsharp/wishkobone/APIClient.kt index 4c319d1..daacc28 100644 --- a/app/src/main/java/au/com/joshsharp/wishkobone/APIClient.kt +++ b/app/src/main/java/au/com/joshsharp/wishkobone/APIClient.kt @@ -21,9 +21,6 @@ class APIClient { } val request: Request = Request.Builder().url(urlBuilder.build()) .get() - .addHeader("User-Agent", agent) - .addHeader("Referer", "https://www.kobo.com/au/en/account/wishlist") - .addHeader("Accept", "application / json, text / javascript, * / *; q = 0.01") .addHeader("X-Requested-With", "XMLHttpRequest") .addHeader("Cookie", "KoboSession=$cookieValue") .build() @@ -33,13 +30,8 @@ class APIClient { fun post(url: String, payload: String, contentType: String, responseHandler: Callback) { val body: RequestBody = payload.toRequestBody(contentType.toMediaType()) val request: Request = Request.Builder().url(getAbsoluteUrl(url)).post(body) - .addHeader("User-Agent", agent) - .addHeader("Referer", "https://www.kobo.com/au/en/account/wishlist") - .addHeader("Accept", "application/json, text/javascript, */*; q=0.01") .addHeader("X-Requested-With", "XMLHttpRequest") - .addHeader("Origin", "https://www.kobo.com") .addHeader("Cookie", "KoboSession=$cookieValue") - .addHeader("Content-type", contentType) .build() client.newCall(request).enqueue(responseHandler) } @@ -49,8 +41,6 @@ class APIClient { private var client: OkHttpClient = OkHttpClient.Builder() .retryOnConnectionFailure(false) .build() - private const val agent = - "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0" private fun getAbsoluteUrl(relativeUrl: String): String { return BASE_URL + relativeUrl }