| 221 | } |
| 222 | |
| 223 | private Object[] proxy2(Map<String, String> params) throws Exception { |
| 224 | String url = params.get("url"); |
| 225 | String header = params.get("header"); |
| 226 | JSArray array = submit(() -> JSUtil.toArray(ctx, Arrays.asList(url.split("/")))).get(); |
| 227 | Object object = submit(() -> ctx.parse(header)).get(); |
| 228 | String proxy = (String) call("proxy", array, object); |
| 229 | Res res = Res.objectFrom(proxy); |
| 230 | Object[] result = new Object[3]; |
| 231 | result[0] = res.getCode(); |
| 232 | result[1] = res.getContentType(); |
| 233 | result[2] = res.getStream(); |
| 234 | return result; |
| 235 | } |
| 236 | |
| 237 | private ByteArrayInputStream getStream(Object o, boolean base64) { |
| 238 | if (o instanceof byte[]) { |