-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
aveek
committed
Jun 19, 2022
1 parent
a20e9d9
commit 00f1d7b
Showing
10 changed files
with
129 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
network/src/main/java/com/moneybox/minimb/network/core/HeaderInterceptor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.moneybox.minimb.network.core | ||
|
||
import com.moneybox.minimb.network.core.INetworkCoreDataService.Companion.API_VERSION | ||
import com.moneybox.minimb.network.core.INetworkCoreDataService.Companion.APP_ID | ||
import com.moneybox.minimb.network.core.INetworkCoreDataService.Companion.VERSION_NAME | ||
import okhttp3.Interceptor | ||
import okhttp3.Response | ||
|
||
class NoAuthenticationInterceptor : Interceptor { | ||
override fun intercept(chain: Interceptor.Chain): Response { | ||
return chain.proceed( | ||
chain.request().newBuilder() | ||
.addHeader(APP_ID_HEADER_NAME, APP_ID) | ||
.addHeader(API_VERSION_HEADER_NAME, API_VERSION) | ||
.addHeader(APP_VERSION_HEADER_NAME, VERSION_NAME) | ||
.addHeader(CONTENT_HEADER_NAME, CONTENT_HEADER_VALUE) | ||
.build() | ||
) | ||
} | ||
|
||
companion object { | ||
private const val APP_ID_HEADER_NAME = "AppId" | ||
private const val API_VERSION_HEADER_NAME = "ApiVersion" | ||
private const val APP_VERSION_HEADER_NAME = "AppVersion" | ||
private const val CONTENT_HEADER_NAME = "ContentDetail-Type" | ||
private const val CONTENT_HEADER_VALUE = "application/json" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters