Skip to content

Commit

Permalink
refactor: remove user/pass replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
jmattheis committed Jul 7, 2024
1 parent 337af76 commit d741e67
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions app/src/main/kotlin/com/github/gotify/CoilInstance.kt
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,12 @@ private class BasicAuthInterceptor : Interceptor {

// If there's no username, skip the authentication
if (request.url.username.isNotEmpty()) {
val basicAuthString = "${request.url.username}:${request.url.password}@"
val url = request.url.toString().replace(basicAuthString, "")
request = request
.newBuilder()
.header(
"Authorization",
Credentials.basic(request.url.username, request.url.password)
)
.url(url)
.build()
}
return chain.proceed(request)
Expand Down

0 comments on commit d741e67

Please sign in to comment.