public Map<String, String> getExtensionParams() {
return extensionParams;
}
public HttpRequest makeHttpRequest(Uri targetUri) throws GadgetException {
HttpRequest req = new HttpRequest(targetUri)
.setIgnoreCache(isNoCache())
.setContainer(getContainer());
if (!Strings.isNullOrEmpty(getGadget())) {
try {
req.setGadget(Uri.parse(getGadget()));
} catch (IllegalArgumentException e) {
throw new GadgetException(GadgetException.Code.INVALID_PARAMETER,
"Invalid " + Param.GADGET.getKey() + " param: " + getGadget(),
HttpResponse.SC_BAD_REQUEST);
}
}
if (getRefresh() != null && getRefresh() >= 0) {
req.setCacheTtl(getRefresh());
}
// Allow the rewriter to use an externally forced MIME type. This is needed
// allows proper rewriting of <script src="x"/> where x is returned with
// a content type like text/html which unfortunately happens all too often
if (rewriteMimeType != null) {
req.setRewriteMimeType(getRewriteMimeType());
}
req.setSanitizationRequested(sanitizeContent());
req.setCajaRequested(cajoleContent());
return req;
}