We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1cf279 commit 100e1bcCopy full SHA for 100e1bc
1 file changed
src/main/java/com/github/packageurl/PackageURL.java
@@ -565,17 +565,18 @@ public static String uriDecode(final String source) {
565
return source;
566
}
567
568
- int firstPercent = source.indexOf('%');
+ int percent = source.indexOf('%');
569
570
- if (firstPercent == -1) {
+ if (percent == -1) {
571
572
573
574
byte[] bytes = source.getBytes(StandardCharsets.UTF_8);
575
int length = bytes.length;
576
ByteArrayOutputStream buffer = new ByteArrayOutputStream(length);
577
+ buffer.write(bytes, 0, percent);
578
- for (int i = 0; i < length; i++) {
579
+ for (int i = percent; i < length; i++) {
580
int b = bytes[i];
581
582
if (b == '%') {
0 commit comments