You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method zio.http.Header.Authorization.parseBasic fails with Basic Authorization header value is not in the format username:password if the password contains a ':'. partsOfBasic.length will be greater than 2 in that case.
private def parseBasic(value: String): Either[String, Authorization] = {
try {
val partsOfBasic = new String(Base64.getDecoder.decode(value)).split(":")
if (partsOfBasic.length == 2) {
Right(Basic(partsOfBasic(0), Secret(partsOfBasic(1))))
} else {
Left("Basic Authorization header value is not in the format username:password")
}
} catch {
case _: IllegalArgumentException =>
Left("Basic Authorization header value is not a valid base64 encoded string")
}
}
The text was updated successfully, but these errors were encountered:
The method
zio.http.Header.Authorization.parseBasic
fails withBasic Authorization header value is not in the format username:password
if the password contains a ':'.partsOfBasic.length
will be greater than 2 in that case.The text was updated successfully, but these errors were encountered: