Skip to content

Commit

Permalink
chore: move to v2 for user queue request and user agent in headers (#461
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Shahroz16 authored Nov 5, 2024
1 parent 7fbc1be commit bebf5a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ class NetworkUtilities {
internal const val CIO_SITE_ID_HEADER = "X-CIO-Site-Id"
internal const val USER_TOKEN_HEADER = "X-Gist-Encoded-User-Token"
internal const val CIO_DATACENTER_HEADER = "X-CIO-Datacenter"
internal const val CIO_CLIENT_PLATFORM = "X-CIO-Client-Platform"
internal const val CIO_CLIENT_VERSION = "X-CIO-Client-Version"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import retrofit2.http.POST
import retrofit2.http.Path

interface GistQueueService {
@POST("/api/v1/users")
@POST("/api/v2/users")
suspend fun fetchMessagesForUser(@Body body: Any = Object()): Response<List<Message>>

@POST("/api/v1/logs/message/{messageId}")
Expand Down Expand Up @@ -69,6 +69,8 @@ class Queue : GistQueue {
val networkRequest = originalRequest.newBuilder()
.addHeader(NetworkUtilities.CIO_SITE_ID_HEADER, state.siteId)
.addHeader(NetworkUtilities.CIO_DATACENTER_HEADER, state.dataCenter)
.addHeader(NetworkUtilities.CIO_CLIENT_PLATFORM, SDKComponent.android().client.source.lowercase())
.addHeader(NetworkUtilities.CIO_CLIENT_VERSION, SDKComponent.android().client.sdkVersion)
.apply {
state.userId?.let { userToken ->
addHeader(
Expand Down

0 comments on commit bebf5a9

Please sign in to comment.