Updated delegation system to account for custom headers

This commit is contained in:
Jobobby04 2020-08-19 18:19:22 -04:00
parent aff15b3ee2
commit 9efb1482f9
3 changed files with 12 additions and 2 deletions

View File

@ -91,7 +91,7 @@ abstract class HttpSource : CatalogueSource {
/** /**
* Headers used for requests. * Headers used for requests.
*/ */
val headers: Headers by lazy { headersBuilder().build() } /* SY --> */ open /* SY <-- */ val headers: Headers by lazy { headersBuilder().build() }
/** /**
* Default network client for doing requests. * Default network client for doing requests.

View File

@ -99,6 +99,11 @@ abstract class DelegatedHttpSource(val delegate: HttpSource) : HttpSource() {
*/ */
override val baseUrl get() = delegate.baseUrl override val baseUrl get() = delegate.baseUrl
/**
* Headers used for requests.
*/
override val headers get() = delegate.headers
/** /**
* Whether the source has support for latest updates. * Whether the source has support for latest updates.
*/ */

View File

@ -103,6 +103,11 @@ class EnhancedHttpSource(
*/ */
override val baseUrl get() = source().baseUrl override val baseUrl get() = source().baseUrl
/**
* Headers used for requests.
*/
override val headers get() = source().headers
/** /**
* Whether the source has support for latest updates. * Whether the source has support for latest updates.
*/ */
@ -128,7 +133,7 @@ class EnhancedHttpSource(
/** /**
* Default network client for doing requests. * Default network client for doing requests.
*/ */
override val client get() = source().client override val client get() = originalSource.client // source().client
/** /**
* Visible name of the source. * Visible name of the source.