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

Sanitizing tokens #141

Open
AlvaroAguilera opened this issue Oct 6, 2021 · 1 comment
Open

Sanitizing tokens #141

AlvaroAguilera opened this issue Oct 6, 2021 · 1 comment

Comments

@AlvaroAguilera
Copy link

There is a minor issue with the sanitation of the tokens.

In our lab, we have Experiment Factory running headless and send tokens per email to the participants.

It has happened several times that when the participants do a copy & paste of the token, they introduce a unicode zero width space character (\u200b). This causes an error when ExpFact tried to check for the existence of the token's directory.

We worked around this issue by using the following code in views/headless.py:69

token = form.token.data.encode('ascii', errors = 'ignore').decode().strip()

This fixed the problem but is probably not the best solution. Perhaps a more thorough sanitation of the tokens is due.

@vsoch
Copy link
Member

vsoch commented Oct 6, 2021

I think that would be a fine solution - quick glances around seem to suggest something similar. Would you care to PR and make this change, add a note to the changelog and version bump? If you are participating I can give you credit for a Hacktoberfest PR!

@AlvaroAguilera AlvaroAguilera mentioned this issue Oct 7, 2021
2 tasks
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