Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Okio's base64 implementation #2870

Merged
merged 1 commit into from Jan 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -9,7 +9,6 @@ import okio.Buffer
import okio.BufferedSink
import okio.BufferedSource
import okio.IOException
import java.util.Base64

/**
* An [OperationMessageSerializer] that uses the format used by
Expand Down Expand Up @@ -112,7 +111,7 @@ class AppSyncOperationMessageSerializer(
private fun Map<String, Any?>.base64Encode(): String {
val buffer = Buffer()
Utils.writeToJson(this, JsonWriter.of(buffer))
return Base64.getUrlEncoder().encodeToString(buffer.readByteArray())
return buffer.readByteString().base64Url()
}
}
}