https://kotlinlang.org logo
#ktor
Title
# ktor
c

Chris C

01/06/2022, 5:41 PM
Just found this bug in beta-1 (also applies to
appendIfNameAndValueAbsent()
)
Copy code
public fun StringValuesBuilder.appendIfNameAbsent(name: String, value: String): StringValuesBuilder = apply {
    if (!contains(name)) return@apply
    append(name, value)
}
I think that
if
should be inverted
not sure how that should be reported - there doesn’t seem to be a beta-1 version in youtrack (assuming that’s where it should be reported?)
h

hfhbd

01/06/2022, 6:11 PM
Yes, youtrack is the right place. Just create two tickets, one for the bug and another for the version 😄
c

Chris C

01/06/2022, 6:25 PM
done 👍
r

Rustam Siniukov

01/07/2022, 3:26 PM
OMG, so embarrassing 🤦 thanks for noticing, will open PR shortly
🙏 2
h

hfhbd

01/07/2022, 3:27 PM
Maybe with a test? 😄
r

Rustam Siniukov

01/07/2022, 3:27 PM
There was a test that used this method, but I used
headers.get(header)
instead of
headers.getAll(header)
. Even more embarrassing 😃
😄 2