import static net.pterodactylus.sone.utils.NumberParsers.parseLong;
+import java.util.Arrays;
+import java.util.Collections;
+
import net.pterodactylus.sone.core.SoneRescuer;
import net.pterodactylus.sone.data.LocalSone;
import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
+import net.pterodactylus.util.web.Header;
import net.pterodactylus.util.web.Method;
/**
templateContext.set("soneRescuer", soneRescuer);
}
+ @Override
+ protected Iterable<Header> getAdditionalHeaders(FreenetRequest request) {
+ LocalSone currentSone = getCurrentSone(request.getToadletContext(), false).get();
+ SoneRescuer soneRescuer = webInterface.getCore().getSoneRescuer(currentSone);
+ if ((request.getMethod() == Method.GET) && soneRescuer.isFetching()) {
+ final Header header = new Header("Refresh");
+ header.addValue("5; url=rescue.html");
+ return Arrays.asList(header);
+ }
+ return Collections.emptyList();
+ }
+
}