Commit 64ec5b2
committed
Fix URL encoding and decoding
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.
Aditionally, if no percent-encoding was performed, these methods will
now return the original string.
Fixes package-url#150
Closes package-url#153
Fixes package-url#1541 parent 62ac909 commit 64ec5b2
File tree
2 files changed
+47
-27
lines changed- src
- main/java/com/github/packageurl
- test/java/com/github/packageurl
2 files changed
+47
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
477 | | - | |
478 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
479 | 483 | | |
480 | 484 | | |
481 | | - | |
482 | | - | |
483 | | - | |
| 485 | + | |
484 | 486 | | |
485 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
486 | 490 | | |
487 | 491 | | |
488 | | - | |
| 492 | + | |
489 | 493 | | |
490 | 494 | | |
491 | 495 | | |
| |||
555 | 559 | | |
556 | 560 | | |
557 | 561 | | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
| 562 | + | |
566 | 563 | | |
567 | 564 | | |
568 | 565 | | |
569 | | - | |
| 566 | + | |
570 | 567 | | |
571 | 568 | | |
572 | | - | |
573 | | - | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
574 | 575 | | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
583 | 589 | | |
584 | 590 | | |
585 | | - | |
| 591 | + | |
| 592 | + | |
586 | 593 | | |
587 | 594 | | |
588 | 595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
73 | 86 | | |
74 | 87 | | |
75 | 88 | | |
| |||
0 commit comments