Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mtda-www
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ class RemoteCallHandler(BaseHandler):
Handles common logic for offloading blocking calls to a thread pool
and centralized error handling for remote interactions.
"""
def set_default_headers(self):
# These GETs change state (keyboard-input, mouse-move, ...). The
# browser must not cache them, or a repeated request (e.g. the
# same key typed twice) would never reach the server.
self.set_header("Cache-Control",
"no-store, no-cache, must-revalidate, max-age=0")
self.set_header("Pragma", "no-cache")

async def get(self):
try:
logger.debug(f"Request: {self.__class__.__name__}")
Expand Down
4 changes: 4 additions & 0 deletions mtda/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,10 @@
<script src="./assets/keyboard.js"></script>
<script src="./assets/keysight.js"></script>
<script type=text/javascript>
// These GETs change state (keyboard-input, mouse-move, ...). Stop
Comment thread
fmoessbauer marked this conversation as resolved.
// the browser from caching them, or a repeated request would be
// dropped instead of reaching the server.
$.ajaxSetup({ cache: false });
window.addEventListener("keydown", function(event) {
// check if the video window is active or ignore keydown event
if (!videoWindow || !videoWindow.focused) {
Expand Down
Loading