Skip to content

Commit ba03cde

Browse files
committed
Removed space from HeaderValue parsing and added trimming
1 parent 402aff7 commit ba03cde

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/javawebstack/http/router/util/HeaderValue.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ public class HeaderValue {
99
private final Map<String, String> directives = new HashMap<>();
1010

1111
public HeaderValue(String source) {
12-
String[] spl = source.split("; ");
13-
value = spl[0];
12+
String[] spl = source.split(";");
13+
value = spl[0].trim();
1414
for(int i=1; i<spl.length; i++) {
15-
String[] spl2 = spl[i].split("=", 2);
15+
String[] spl2 = spl[i].trim().split("=", 2);
1616
String value = spl2.length == 2 ? spl2[1] : "";
1717
if(value.startsWith("\"") && value.endsWith("\"")) {
1818
value = value.substring(1, value.length()-1);

0 commit comments

Comments
 (0)