}
private WebResponse makeWebResponseForDataUrl(final WebRequestSettings webRequestSettings) throws IOException {
final URL url = webRequestSettings.getUrl();
final List<NameValuePair> responseHeaders = new ArrayList<NameValuePair>();
DataUrlDecoder decoder;
try {
decoder = DataUrlDecoder.decode(url);
}
catch (final DecoderException e) {
throw new IOException(e.getMessage());
}
responseHeaders.add(new NameValuePair("content-type",
decoder.getMediaType() + ";charset=" + decoder.getCharset()));
final WebResponseData data = new WebResponseData(url.openStream(), 200, "OK", responseHeaders);
return new WebResponseImpl(data, url, webRequestSettings.getHttpMethod(), 0);
}