Skip to content

Commit f772c15

Browse files
committed
[BOOK-275] refactor: 쿼리 파리미터로 보낸 API 키를 헤더로 전환
1 parent 14d6c15 commit f772c15

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

core/ocr/src/main/kotlin/com/ninecraft/booket/core/ocr/analyzer/CloudOcrRecognizer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CloudOcrRecognizer @Inject constructor(
2626
)
2727

2828
service.batchAnnotateImage(
29-
key = BuildConfig.CLOUD_VISION_API_KEY,
29+
apiKey = BuildConfig.CLOUD_VISION_API_KEY,
3030
body = request,
3131
)
3232
}

core/ocr/src/main/kotlin/com/ninecraft/booket/core/ocr/di/CloudVisionNetworkModule.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ object CloudVisionNetworkModule {
4040
@CloudVisionOkHttp
4141
fun provideOkHttp(): OkHttpClient {
4242
val log = HttpLoggingInterceptor().apply {
43+
redactHeader("X-Goog-Api-Key")
4344
level = if (BuildConfig.DEBUG) {
4445
HttpLoggingInterceptor.Level.BASIC
4546
} else {

core/ocr/src/main/kotlin/com/ninecraft/booket/core/ocr/service/CloudVisionService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package com.ninecraft.booket.core.ocr.service
33
import com.ninecraft.booket.core.ocr.model.CloudVisionRequest
44
import com.ninecraft.booket.core.ocr.model.CloudVisionResponse
55
import retrofit2.http.Body
6+
import retrofit2.http.Header
67
import retrofit2.http.POST
7-
import retrofit2.http.Query
88

99
interface CloudVisionService {
1010
@POST("v1/images:annotate")
1111
suspend fun batchAnnotateImage(
12-
@Query("key") key: String,
12+
@Header("X-Goog-Api-Key") apiKey: String,
1313
@Body body: CloudVisionRequest,
1414
): CloudVisionResponse
1515
}

0 commit comments

Comments
 (0)