mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 20:26:48 +00:00
fix(console): a VNC console connects to the VM its page was opened for
- novncd takes the console token only from its websocket URL. The page also put the token in a cookie, one for the whole browser, and novncd preferred the cookie: with two consoles open, a tab that (re)connected after another console was opened got that other VM. - novncd opens the VM by its UUID, the VM the access check was made for, not by its name, which another VM on the host may carry now.
This commit is contained in:
parent
8d7f28482f
commit
cbd6317e55
3 changed files with 24 additions and 76 deletions
|
|
@ -150,9 +150,4 @@ def console(request):
|
|||
"Console type '%(type)s' is not supported. Please switch the VM graphics to VNC."
|
||||
) % {"type": console_type}
|
||||
response = render(request, "console-vnc-lite.html", locals())
|
||||
|
||||
# Only novncd reads this cookie; JavaScript gets the token from the page.
|
||||
response.set_cookie(
|
||||
"token", token, httponly=True, samesite="Lax", secure=request.is_secure()
|
||||
)
|
||||
return response
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue