mirror of
https://github.com/revanced/revanced-api.git
synced 2025-04-29 22:24:31 +02:00
refactor: Lint & code cleanup
This commit is contained in:
parent
39f54bbb32
commit
0904390481
@ -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(
|
||||
|
@ -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)
|
||||
},
|
||||
)
|
||||
}
|
||||
@ -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)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
@ -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))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user