Skip to content

Commit 80c1db1

Browse files
authored
Merge pull request #98 from danielfrg/tmp-file-cookie
Use tmp file for secure cookie
2 parents 3c6e224 + 72e1118 commit 80c1db1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jupyter_rsession_proxy/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import tempfile
77
from textwrap import dedent
88

9+
910
def get_rstudio_executable(prog):
1011
# Find prog in known locations
1112
other_paths = [
@@ -55,12 +56,15 @@ def db_config():
5556
return db_config_name
5657

5758
def _get_cmd(port):
59+
ntf = tempfile.NamedTemporaryFile()
5860
cmd = [
5961
get_rstudio_executable('rserver'),
6062
'--auth-none=1',
6163
'--www-frame-origin=same',
6264
'--www-port=' + str(port),
63-
'--www-verify-user-agent=0'
65+
'--www-verify-user-agent=0',
66+
'--secure-cookie-key-file=' + ntf.name,
67+
'--server-user=' + getpass.getuser(),
6468
]
6569

6670
# Add additional options for RStudio >= 1.4.x. Since we cannot

0 commit comments

Comments
 (0)