Skip to content

Commit

Permalink
Add a check on proxy vs non proxy server before updatinr the request …
Browse files Browse the repository at this point in the history
…path (#2896)
  • Loading branch information
dubdabasoduba authored Nov 30, 2023
1 parent 6ba5153 commit 8cc5646
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import okhttp3.Protocol
import okhttp3.Response
import okhttp3.ResponseBody.Companion.toResponseBody
import okhttp3.logging.HttpLoggingInterceptor
import org.smartregister.fhircore.engine.BuildConfig
import org.smartregister.fhircore.engine.OpenSrpApplication
import org.smartregister.fhircore.engine.configuration.app.ConfigService
import org.smartregister.fhircore.engine.data.remote.auth.KeycloakService
Expand All @@ -54,6 +55,7 @@ import timber.log.Timber
@InstallIn(SingletonComponent::class)
@Module
class NetworkModule {
private var _isNonProxy = BuildConfig.IS_NON_PROXY_APK

@Provides
@NoAuthorizationOkHttpClientQualifier
Expand Down Expand Up @@ -84,7 +86,7 @@ class NetworkModule {
try {
var request = chain.request()
val requestPath = request.url.encodedPath.substring(1)
val resourcePath = requestPath.replace("fhir/", "")
val resourcePath = if (!_isNonProxy) requestPath.replace("fhir/", "") else requestPath

openSrpApplication?.let {
if (
Expand Down

0 comments on commit 8cc5646

Please sign in to comment.