Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authrevproxy byte object #7

Open
hadjigc opened this issue Mar 31, 2021 · 1 comment
Open

authrevproxy byte object #7

hadjigc opened this issue Mar 31, 2021 · 1 comment

Comments

@hadjigc
Copy link

hadjigc commented Mar 31, 2021

Hi, I Installed the TensorBoard app in OnDemand 1.7 and had some issues getting the authrevproxy script working properly initially.
The issues seem to be due to a newer version of Twisted with Python3 using byte objects instead of strings.
The following line wasn't working:

cookie = request.getCookie('_ood_token_' + ood_session_id)

The request.received_cookies object which the function searches was returning a byte object dict
so I had to change it to the following

cookie = request.getCookie(str('_ood_token_' + ood_session_id).encode())

And also decode the cookie afterwards:
if cookie.decode() == ood_token and cookie != None:

The last argument in the return function also needed to be a byte object:

                return proxy.ReverseProxyResource(self.host,
                                                  self.port,
                                                  b'/' + path)

Hopefully this helps if someone has trouble getting the app working.

Regards,
Chris

@kcgthb
Copy link
Member

kcgthb commented Mar 31, 2021

Hi Chris,

Thanks for the note for suggesting those fixes. Twisted has changed significantly since we wrote this, so I guess an update to support new versions is probably warranted, indeed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants