From c5452d405cbb80a479873c6793d2b6c8b31f666c Mon Sep 17 00:00:00 2001 From: Jaroslav Tulach Date: Sun, 6 Sep 2015 11:35:27 +0200 Subject: [PATCH] Handle the headers as introduced in HTML/Java version 1.2 --- .../test/java/org/teavm/html4j/test/KnockoutFXTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/teavm-html4j/src/test/java/org/teavm/html4j/test/KnockoutFXTest.java b/teavm-html4j/src/test/java/org/teavm/html4j/test/KnockoutFXTest.java index 3134c453c..a03433314 100644 --- a/teavm-html4j/src/test/java/org/teavm/html4j/test/KnockoutFXTest.java +++ b/teavm-html4j/src/test/java/org/teavm/html4j/test/KnockoutFXTest.java @@ -150,6 +150,14 @@ public final class KnockoutFXTest extends KnockoutTCK implements Transfer { break; } String value = data.parameters[i]; + if (value.startsWith("http.header.")) { + String header = value.substring(12); + int line = call.getHeaders().indexOf(header); + int end = call.getHeaders().indexOf("\n", line); + if (line >= 0 && end > line) { + value = call.getHeaders().substring(line + header.length() + 1, end).trim(); + } + } if (value.equals("http.method")) { value = call.getMethod(); }