Skip to content

Commit ad7477a

Browse files
committed
format fix
1 parent 3f683e6 commit ad7477a

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

firebase-functions/src/main/java/com/google/firebase/functions/PublisherStream.kt

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,20 @@ internal class PublisherStream(
136136
MediaType.parse("application/json"),
137137
JSONObject(mapOf("data" to serializer.encode(data))).toString()
138138
)
139-
val request = Request.Builder().url(url).post(requestBody).apply {
140-
header("Accept", "text/event-stream")
141-
header("Content-Type", "application/json")
142-
context?.apply {
143-
authToken?.let { header("Authorization", "Bearer $it") }
144-
instanceIdToken?.let { header("Firebase-Instance-ID-Token", it) }
145-
appCheckToken?.let { header("X-Firebase-AppCheck", it) }
146-
}
147-
}.build()
139+
val request =
140+
Request.Builder()
141+
.url(url)
142+
.post(requestBody)
143+
.apply {
144+
header("Accept", "text/event-stream")
145+
header("Content-Type", "application/json")
146+
context?.apply {
147+
authToken?.let { header("Authorization", "Bearer $it") }
148+
instanceIdToken?.let { header("Firebase-Instance-ID-Token", it) }
149+
appCheckToken?.let { header("X-Firebase-AppCheck", it) }
150+
}
151+
}
152+
.build()
148153
val call = configuredClient.newCall(request)
149154
activeCall = call
150155

@@ -303,7 +308,10 @@ internal class PublisherStream(
303308
if (response.isSuccessful) return
304309

305310
val errorMessage: String
306-
if (response.code() == 404 && MediaType.get(response.header("Content-Type")?: "").subtype() == "html") {
311+
if (
312+
response.code() == 404 &&
313+
MediaType.get(response.header("Content-Type") ?: "").subtype() == "html"
314+
) {
307315
errorMessage = """URL not found. Raw response: ${response.body()?.string()}""".trimMargin()
308316
notifyError(
309317
FirebaseFunctionsException(

0 commit comments

Comments
 (0)