Skip to content

Commit

Permalink
refactor: Lint & code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Jun 5, 2024
1 parent 14618ea commit a9f55a9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/main/kotlin/app/revanced/api/command/StartAPICommand.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package app.revanced.api.command

import app.revanced.api.configuration.*
import app.revanced.api.configuration.configureDependencies
import app.revanced.api.configuration.configureHTTP
import app.revanced.api.configuration.configureSecurity
import app.revanced.api.configuration.configureSerialization
import app.revanced.api.configuration.routing.configureRouting
import io.ktor.server.application.*
import io.ktor.server.engine.*
import io.ktor.server.netty.*
import io.ktor.server.response.*
import io.ktor.server.routing.*
import picocli.CommandLine

@CommandLine.Command(
Expand Down
13 changes: 8 additions & 5 deletions src/main/kotlin/app/revanced/api/repository/OldApiService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ internal class OldApiService(private val client: HttpClient) {
!key.equals(
HttpHeaders.ContentType,
ignoreCase = true,
) && !key.equals(
HttpHeaders.ContentLength,
ignoreCase = true,
) && !key.equals(HttpHeaders.Host, ignoreCase = true)
) &&
!key.equals(
HttpHeaders.ContentLength,
ignoreCase = true,
) &&
!key.equals(HttpHeaders.Host, ignoreCase = true)
},
)
}
Expand All @@ -51,7 +53,8 @@ internal class OldApiService(private val client: HttpClient) {
!key.equals(
HttpHeaders.ContentType,
ignoreCase = true,
) && !key.equals(HttpHeaders.ContentLength, ignoreCase = true)
) &&
!key.equals(HttpHeaders.ContentLength, ignoreCase = true)
},
)
}
Expand Down
10 changes: 4 additions & 6 deletions src/main/kotlin/app/revanced/api/services/AuthService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ internal class AuthService(
}
}

fun newToken(): String {
return JWT.create()
.withIssuer(issuer)
.withExpiresAt(Date(System.currentTimeMillis() + validityInMin.minutes.inWholeMilliseconds))
.sign(Algorithm.HMAC256(jwtSecret))
}
fun newToken(): String = JWT.create()
.withIssuer(issuer)
.withExpiresAt(Date(System.currentTimeMillis() + validityInMin.minutes.inWholeMilliseconds))
.sign(Algorithm.HMAC256(jwtSecret))
}

0 comments on commit a9f55a9

Please sign in to comment.