croservices / cro-core

The heart of the Cro library for building distributed systems in Raku, including pipeline composition and TCP support.
https://cro.services/
Artistic License 2.0
27 stars 9 forks source link

[Cro::Uri] `encode-percents` incorrectly encodes newline as `%A` #27

Closed CIAvash closed 3 years ago

CIAvash commented 3 years ago

encode-percents "\n" returns %A, but if I'm not mistaken it should be %0A.

Altai-man commented 3 years ago

You are right, https://github.com/croservices/cro-core/commit/1b22aef4732e9b32bdd971cf10c13e5b203766cc#diff-a1969aa0318254989aa488f71f4f20a215d3b7684b4b7013a369546127f99ed3R520 should format the result to prepend 0 if there is a single character.

Altai-man commented 3 years ago

This was fixed with https://github.com/croservices/cro-core/pull/28 merge.

jnthn commented 3 years ago

@Altai-man Is there a test that covers this fix?

Altai-man commented 3 years ago

Yes, https://github.com/croservices/cro-core/pull/28/files#diff-2650b67a0f2d974afb0e444b66f52a0ed322181e2cdabac17bd41cbb150f7091R537