Skip to content

Commit

Permalink
fix code to parse Basic Authorization when the password contains ":"
Browse files Browse the repository at this point in the history
  • Loading branch information
camarena committed Oct 23, 2024
1 parent dff0b93 commit ca937dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zio-http/shared/src/main/scala/zio/http/Header.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ object Header {

private def parseBasic(value: String): Either[String, Authorization] = {
try {
val partsOfBasic = new String(Base64.getDecoder.decode(value)).split(":")
val partsOfBasic = new String(Base64.getDecoder.decode(value)).split(":", 2)
if (partsOfBasic.length == 2) {
Right(Basic(partsOfBasic(0), Secret(partsOfBasic(1))))
} else {
Expand Down

0 comments on commit ca937dc

Please sign in to comment.