Skip to content

Commit

Permalink
Removed space from HeaderValue parsing and added trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
x7airworker committed Oct 31, 2023
1 parent 402aff7 commit ba03cde
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public class HeaderValue {
private final Map<String, String> directives = new HashMap<>();

public HeaderValue(String source) {
String[] spl = source.split("; ");
value = spl[0];
String[] spl = source.split(";");
value = spl[0].trim();
for(int i=1; i<spl.length; i++) {
String[] spl2 = spl[i].split("=", 2);
String[] spl2 = spl[i].trim().split("=", 2);
String value = spl2.length == 2 ? spl2[1] : "";
if(value.startsWith("\"") && value.endsWith("\"")) {
value = value.substring(1, value.length()-1);
Expand Down

0 comments on commit ba03cde

Please sign in to comment.