add noscript option to FileServer
This commit is contained in:
parent
fd83813ecf
commit
ec74401896
1 changed files with 9 additions and 0 deletions
|
@ -8,12 +8,14 @@ import org.w3c.dom.Element;
|
|||
|
||||
import de.tudbut.async.Callback;
|
||||
import de.tudbut.async.ComposeCallback;
|
||||
import de.tudbut.async.Task;
|
||||
import de.tudbut.async.TaskCallable;
|
||||
import de.tudbut.tryumph.config.IRequestCatcher;
|
||||
import de.tudbut.tryumph.config.TryConfig;
|
||||
import de.tudbut.tryumph.events.GET;
|
||||
import de.tudbut.tryumph.events.Path;
|
||||
import de.tudbut.tryumph.events.RequestHandler;
|
||||
import de.tudbut.tryumph.server.BrowserContext;
|
||||
import de.tudbut.tryumph.server.Request;
|
||||
import de.tudbut.tryumph.server.Response;
|
||||
import tudbut.parsing.TCN;
|
||||
|
@ -89,4 +91,11 @@ public class FileServer implements IRequestCatcher, RequestHandler.Listener {
|
|||
rej.call(error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Task<BrowserContext> processBrowserContext(BrowserContext context) {
|
||||
if(data.getBoolean("noscript") != null)
|
||||
context.useJavaScript = !data.getBoolean("noscript");
|
||||
return IRequestCatcher.super.processBrowserContext(context);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue