author | aeubanks |
Wed, 27 Mar 2019 09:06:43 -0700 | |
changeset 54314 | 46cf212cdcca |
parent 47216 | 71c04702a3d5 |
child 55309 | 8081b181bba8 |
permissions | -rw-r--r-- |
27177
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
1 |
/* |
38883 | 2 |
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
27177
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
4 |
* |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
8 |
* |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
13 |
* accompanied this code). |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
14 |
* |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
18 |
* |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
21 |
* questions. |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
22 |
*/ |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
23 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
24 |
/** |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
25 |
* @test |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
26 |
* @bug 8042622 |
54314
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
27 |
* @library /test/lib |
27177
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
28 |
* @summary Check for CRL results in IllegalArgumentException "white space not allowed" |
38883 | 29 |
* @modules jdk.httpserver |
27177
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
30 |
* @run main/othervm Test2 |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
31 |
*/ |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
32 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
33 |
import com.sun.net.httpserver.*; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
34 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
35 |
import java.util.*; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
36 |
import java.util.concurrent.*; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
37 |
import java.io.*; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
38 |
import java.net.*; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
39 |
import java.security.*; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
40 |
import javax.security.auth.callback.*; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
41 |
import javax.net.ssl.*; |
54314
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
42 |
import jdk.test.lib.net.URIBuilder; |
27177
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
43 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
44 |
public class Test2 { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
45 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
46 |
static volatile boolean failed = false; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
47 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
48 |
static class Cache extends ResponseCache { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
49 |
public CacheResponse get(URI uri, String method, Map<String,List<String>> headers) { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
50 |
Set<String> keys = headers.keySet(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
51 |
for (String key : keys) { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
52 |
if (key.indexOf(' ') != -1 || key.indexOf('\t') != -1 |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
53 |
|| key.indexOf(':') != -1) |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
54 |
{ |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
55 |
failed = true; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
56 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
57 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
58 |
return null; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
59 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
60 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
61 |
public CacheRequest put(URI uri, URLConnection c) throws IOException { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
62 |
return null; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
63 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
64 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
65 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
66 |
static int port; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
67 |
|
54314
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
68 |
static URL url, redir; |
27177
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
69 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
70 |
public static void main (String[] args) throws Exception { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
71 |
Handler handler = new Handler(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
72 |
InetSocketAddress addr = new InetSocketAddress (0); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
73 |
HttpServer server = HttpServer.create (addr, 0); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
74 |
port = server.getAddress().getPort(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
75 |
HttpContext ctx = server.createContext ("/test", handler); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
76 |
System.out.println ("Server: " + server.getAddress().getPort()); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
77 |
ResponseCache.setDefault(new Cache()); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
78 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
79 |
ExecutorService executor = Executors.newCachedThreadPool(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
80 |
server.setExecutor (executor); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
81 |
server.start (); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
82 |
|
54314
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
83 |
url = URIBuilder.newBuilder() |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
84 |
.scheme("http") |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
85 |
.loopback() |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
86 |
.port(port) |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
87 |
.path("/test/foo") |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
88 |
.toURLUnchecked(); |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
89 |
System.out.println("URL: " + url); |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
90 |
redir = URIBuilder.newBuilder() |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
91 |
.scheme("http") |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
92 |
.loopback() |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
93 |
.port(port) |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
94 |
.path("/test/foo/redirect/bar") |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
95 |
.toURLUnchecked(); |
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
96 |
System.out.println("Redir URL: " + redir); |
27177
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
97 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
98 |
HttpURLConnection urlc = (HttpURLConnection)url.openConnection(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
99 |
urlc.addRequestProperty("X-Foo", "bar"); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
100 |
urlc.setInstanceFollowRedirects(true); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
101 |
System.out.println(urlc.getResponseCode()); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
102 |
InputStream i = urlc.getInputStream(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
103 |
int count=0; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
104 |
for (int c=i.read(); c!=-1; c=i.read()) { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
105 |
//System.out.write(c); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
106 |
count++; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
107 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
108 |
System.out.println("Read " + count); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
109 |
System.out.println("FINISHED"); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
110 |
server.stop(0); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
111 |
executor.shutdownNow(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
112 |
if (failed) { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
113 |
throw new RuntimeException("Test failed"); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
114 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
115 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
116 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
117 |
public static boolean error = false; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
118 |
public static int count = 0; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
119 |
|
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
120 |
static class Handler implements HttpHandler { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
121 |
int invocation = 0; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
122 |
public void handle (HttpExchange t) |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
123 |
throws IOException |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
124 |
{ |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
125 |
InputStream is = t.getRequestBody(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
126 |
Headers map = t.getRequestHeaders(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
127 |
Headers rmap = t.getResponseHeaders(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
128 |
invocation ++; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
129 |
if (invocation == 1) { |
54314
46cf212cdcca
8220575: Replace hardcoded 127.0.0.1 in URLs with new URI builder
aeubanks
parents:
47216
diff
changeset
|
130 |
rmap.add("Location", redir.toString()); |
27177
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
131 |
while (is.read () != -1) ; |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
132 |
is.close(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
133 |
System.out.println ("sending response"); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
134 |
t.sendResponseHeaders (301, 0); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
135 |
} else { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
136 |
byte[] buf = "Hello world".getBytes(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
137 |
t.sendResponseHeaders (200, buf.length); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
138 |
OutputStream os = t.getResponseBody(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
139 |
try { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
140 |
os.write(buf); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
141 |
} catch (IOException e) { |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
142 |
System.out.println ("EX 1 " + e); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
143 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
144 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
145 |
System.out.println ("Closing"); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
146 |
t.close(); |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
147 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
148 |
} |
3717db2c3bfe
8042622: Check for CRL results in IllegalArgumentException "white space not allowed"
michaelm
parents:
diff
changeset
|
149 |
} |