[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #11218 [BridgeDB]: bridgedb.HTTPServer.ReCaptchaProtectedResource.checkSolution() doesn't expect a deferred
#11218: bridgedb.HTTPServer.ReCaptchaProtectedResource.checkSolution() doesn't
expect a deferred
--------------------------------------------------+----------------------
Reporter: isis | Owner: isis
Type: defect | Status: new
Priority: blocker | Milestone:
Component: BridgeDB | Version:
Keywords: bridgedb-https, bridgedb-0.1.6, easy | Actual Points:
Parent ID: | Points:
--------------------------------------------------+----------------------
From bridgedb-0.1.5,
`bridgedb.HTTPServer.ReCaptchaProtectedResource.checkSolution()` expects a
`bool` for the `solution` internal variable, not a `t.i.defer.Deferred`:
{{{
Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/web/http.py", line 1349,
in dataReceived
finishCallback(data[contentLength:])
File "/usr/lib/python2.7/dist-packages/twisted/web/http.py", line 1563,
in _finishRequestBody
self.allContentReceived()
File "/usr/lib/python2.7/dist-packages/twisted/web/http.py", line 1618,
in allContentReceived
req.requestReceived(command, path, version)
File "/usr/lib/python2.7/dist-packages/twisted/web/http.py", line 773,
in requestReceived
self.process()
--- <exception caught here> ---
File "/usr/lib/python2.7/dist-packages/twisted/web/server.py", line 132,
in process
self.render(resrc)
File "/usr/lib/python2.7/dist-packages/twisted/web/server.py", line 167,
in render
body = resrc.render(self)
File "/usr/lib/python2.7/dist-packages/twisted/web/resource.py", line
216, in render
return m(request)
File "/srv/bridges.torproject.org/local/lib/python2.7/site-
packages/bridgedb-0.1.5_dirty-py2.7.egg/bridgedb/HTTPServer.py", line 470,
in render_POST
return CaptchaProtectedResource.render_POST(self, request)
File "/srv/bridges.torproject.org/local/lib/python2.7/site-
packages/bridgedb-0.1.5_dirty-py2.7.egg/bridgedb/HTTPServer.py", line 220,
in render_POST
if self.checkSolution(request):
File "/srv/bridges.torproject.org/local/lib/python2.7/site-
packages/bridgedb-0.1.5_dirty-py2.7.egg/bridgedb/HTTPServer.py", line 432,
in checkSolution
if solution.is_valid:
exceptions.AttributeError: Deferred instance has no attribute 'is_valid'
}}}
Should be easy, just reorder the current code to make `solution.is_valid`
be checked inside a callback function on the deferred returned from
`txrecaptcha.submit()`. See the `test_submit_resultIsRecaptchaResponse()`
unittest for an example of how it was designed to work.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/11218>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs