Skip to content

Commit

Permalink
Added token as a query parameter to embed file
Browse files Browse the repository at this point in the history
  • Loading branch information
LotuxPunk committed May 25, 2024
1 parent 2c69659 commit 6aaf075
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/be/vandeas/plugins/Routing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fun Application.configureRouting() {
get("/embed/{path}/{fileName}") {
val path = call.parameters["path"] ?: ""
val fileName = call.parameters["fileName"] ?: ""
val authorization = call.request.authorization() ?: throw IllegalArgumentException("Authorization header is required")
val authorization = call.request.queryParameters["token"] ?: call.request.authorization() ?: throw IllegalArgumentException("Authorization header is required")

if (path.isBlank() || fileName.isBlank()) {
call.respond(HttpStatusCode.BadRequest, mapOf("path" to path, "fileName" to fileName))
Expand Down

0 comments on commit 6aaf075

Please sign in to comment.