diff options
author | Adam Domurad <[email protected]> | 2013-02-14 15:29:34 -0500 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2013-02-14 15:29:34 -0500 |
commit | 5f81c444fcb54e316999146db197bfe2d1aaaaef (patch) | |
tree | 440a675ba0df5023ab14fd0ba0ac3c6e80981dd5 | |
parent | 54de67be9138533a6a7e47ab02d22e433cb21caf (diff) |
Support HEAD requests in reproducer system HTTP implementation
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java | 11 |
2 files changed, 15 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2013-02-14 Adam Domurad <[email protected]> + + * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: + Support HEAD requests. + 2013-02-13 Adam Domurad <[email protected]> Fix PR580: http://www.horaoficial.cl/ loads improperly. Applets that diff --git a/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java b/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java index c6212b8..0334d1c 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java +++ b/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java @@ -89,7 +89,11 @@ class TinyHttpdImpl extends Thread { if (s.length() < 1) { break; } - if (s.startsWith("GET")) { + + boolean isGetRequest = s.startsWith("GET"); + boolean isHeadRequest = s.startsWith("HEAD"); + + if (isGetRequest || isHeadRequest ) { StringTokenizer t = new StringTokenizer(s, " "); t.nextToken(); String op = t.nextToken(); @@ -117,6 +121,11 @@ class TinyHttpdImpl extends Thread { content = ct + "application/x-jar\n"; } o.writeBytes("HTTP/1.0 200 OK\nContent-Length:" + l + "\n" + content + "\n"); + + if (isHeadRequest) { + continue; // Skip sending body + } + if (op.startsWith(XSX)) { byte[][] bb = splitArray(b, 10); for (int j = 0; j < bb.length; j++) { |