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

Handle some errors from the captcha generator. #378

Merged
merged 1 commit into from Aug 26, 2015

Conversation

ralphbean
Copy link
Contributor

The main case here is where we handle HTTPGone. The vast majority of our
production tracebacks are from here where (somehow) people are loading forms
that generate captchas (which works) and then way later, they are requesting
those same captcha images again (over 300 seconds later.. that's like 5
minutes). I bet this is happening if someone has a bodhi update page open,
and then their browser crashes and tries to restore its previous state, or
something like that.

Anyways, this patch adds a catch to that main "captcha is expired"
InvalidToken traceback that is spamming our logs. It turns it into a 410
Gone statuscode, which makes sense. While testing it, I tried passing in
garbage which generated a different TypeError from the base64 module, so I
caught that too.

Fixes #237.

The main case here is where we handle HTTPGone.  The vast majority of our
production tracebacks are from here where (somehow) people are loading forms
that generate captchas (which works) and then way later, they are requesting
those same captcha images again (over 300 seconds later.. that's like 5
minutes). I *bet* this is happening if someone has a bodhi update page open,
and then their browser crashes and tries to restore its previous state, or
something like that.

Anyways, this patch adds a catch to that main "captcha is expired"
``InvalidToken`` traceback that is spamming our logs.  It turns it into a 410
Gone statuscode, which makes sense. While testing it, I tried passing in
garbage which generated a different ``TypeError`` from the base64 module, so I
caught that too.

Fixes #237.
@lmacken
Copy link
Contributor

lmacken commented Aug 26, 2015

Looks good to me, 👍

lmacken added a commit that referenced this pull request Aug 26, 2015
Handle some errors from the captcha generator.
@lmacken lmacken merged commit dc5c90a into develop Aug 26, 2015
@lmacken lmacken deleted the feature/captcha-errors branch August 26, 2015 16:43
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

Successfully merging this pull request may close these issues.

None yet

2 participants