Skip to content

Commit

Permalink
Merge 095a5dd into a62c875
Browse files Browse the repository at this point in the history
  • Loading branch information
adinauer authored May 30, 2023
2 parents a62c875 + 095a5dd commit c8c3414
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class SentryApollo3HttpInterceptor @JvmOverloads constructor(private val hub: IH
private fun decodeHeaderValue(request: HttpRequest, headerName: String): String? {
return request.valueForHeader(headerName)?.let {
try {
String(Base64.decode(it, Base64.DEFAULT))
String(Base64.decode(it, Base64.NO_WRAP))
} catch (e: IllegalArgumentException) {
hub.options.logger.log(SentryLevel.ERROR, "Error decoding internal apolloHeader $headerName", e)
return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class SentryApollo3Interceptor : ApolloInterceptor {
chain: ApolloInterceptorChain
): Flow<ApolloResponse<D>> {
val builder = request.newBuilder()
.addHttpHeader(SENTRY_APOLLO_3_OPERATION_TYPE, Base64.encodeToString(operationType(request).toByteArray(), Base64.DEFAULT))
.addHttpHeader(SENTRY_APOLLO_3_OPERATION_NAME, Base64.encodeToString(request.operation.name().toByteArray(), Base64.DEFAULT))
.addHttpHeader(SENTRY_APOLLO_3_OPERATION_TYPE, Base64.encodeToString(operationType(request).toByteArray(), Base64.NO_WRAP))
.addHttpHeader(SENTRY_APOLLO_3_OPERATION_NAME, Base64.encodeToString(request.operation.name().toByteArray(), Base64.NO_WRAP))

request.scalarAdapters?.let {
builder.addHttpHeader(SENTRY_APOLLO_3_VARIABLES, Base64.encodeToString(request.operation.variables(it).valueMap.toString().toByteArray(), Base64.DEFAULT))
builder.addHttpHeader(SENTRY_APOLLO_3_VARIABLES, Base64.encodeToString(request.operation.variables(it).valueMap.toString().toByteArray(), Base64.NO_WRAP))
}
return chain.proceed(builder.build())
}
Expand Down

0 comments on commit c8c3414

Please sign in to comment.