Skip to content

Commit

Permalink
Merge pull request #439 from hyeeyoung/dev-user-agent-header
Browse files Browse the repository at this point in the history
User-Agent ์ถ”๊ฐ€ ๋ฐ ๋ฒ„์ „ ์ฝ”๋“œ ์—…๋ฐ์ดํŠธ
  • Loading branch information
youngjinc authored Jul 14, 2024
2 parents 184a09f + 2f66615 commit 3e0d9e5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
10 changes: 4 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

android {
compileSdkVersion 33
buildToolsVersion "30.0.3"

compileOptions {
coreLibraryDesugaringEnabled true

Expand All @@ -27,9 +24,10 @@ android {
defaultConfig {
applicationId "com.hyeeyoung.wishboard"
minSdkVersion 24
targetSdkVersion 33
versionCode 36
versionName "1.2.4"
targetSdkVersion 34
versionCode 39
versionName "1.2.6"
compileSdk 34

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<uses-feature
android:name="android.hardware.camera2"
android:required="false" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<application
android:name=".WishBoardApp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ class AuthInterceptor @Inject constructor(

private fun Request.newAuthBuilder() =
this.newBuilder()
.addHeader(AUTHORIZATION, "$TOKEN_PREF${localStorage.accessToken}")
.addHeader(HEADER_KEY_AUTHORIZATION, "$TOKEN_PREF${localStorage.accessToken}")
.addHeader(HEADER_KEY_USER_AGENT, "$HEADER_VALUE_USER_AGENT_PREF${if (BuildConfig.DEBUG) "dev" else "prod"}")

companion object {
private const val AUTHORIZATION = "Authorization"
private const val HEADER_KEY_AUTHORIZATION = "Authorization"
private const val HEADER_KEY_USER_AGENT = "User-Agent"
private const val HEADER_VALUE_USER_AGENT_PREF = "wishboard-android/"
private const val TOKEN_PREF = "Bearer "
private const val REFRESH_TOKEN = "refreshToken"
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/hyeeyoung/wishboard/di/NetworkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ object NetworkModule {
interceptor: AuthInterceptor,
): OkHttpClient =
OkHttpClient.Builder().apply {
connectTimeout(10, TimeUnit.SECONDS)
writeTimeout(10, TimeUnit.SECONDS)
readTimeout(10, TimeUnit.SECONDS)
connectTimeout(30, TimeUnit.SECONDS)
writeTimeout(30, TimeUnit.SECONDS)
readTimeout(30, TimeUnit.SECONDS)
addInterceptor(interceptor)
if (DEBUG) addInterceptor(
HttpLoggingInterceptor().apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ class DayItemView @JvmOverloads constructor(
}
}

override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
if (canvas == null) return

val date = date.dayOfMonth.toString()
paint.getTextBounds(date, 0, date.length, bounds)
Expand Down

0 comments on commit 3e0d9e5

Please sign in to comment.