Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
478b4e3e
Commit
478b4e3e
authored
9 years ago
by
Mark Haines
Browse files
Options
Downloads
Patches
Plain Diff
Reuse the captcha client rather than creating a new one for each request
parent
b8680b82
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/register.py
+2
-4
2 additions, 4 deletions
synapse/handlers/register.py
with
2 additions
and
4 deletions
synapse/handlers/register.py
+
2
−
4
View file @
478b4e3e
...
@@ -42,6 +42,7 @@ class RegistrationHandler(BaseHandler):
...
@@ -42,6 +42,7 @@ class RegistrationHandler(BaseHandler):
self
.
distributor
=
hs
.
get_distributor
()
self
.
distributor
=
hs
.
get_distributor
()
self
.
distributor
.
declare
(
"
registered_user
"
)
self
.
distributor
.
declare
(
"
registered_user
"
)
self
.
captch_client
=
CaptchaServerHttpClient
(
hs
)
@defer.inlineCallbacks
@defer.inlineCallbacks
def
check_username
(
self
,
localpart
):
def
check_username
(
self
,
localpart
):
...
@@ -306,10 +307,7 @@ class RegistrationHandler(BaseHandler):
...
@@ -306,10 +307,7 @@ class RegistrationHandler(BaseHandler):
"""
"""
Used only by c/s api v1
Used only by c/s api v1
"""
"""
# TODO: get this from the homeserver rather than creating a new one for
data
=
yield
self
.
captcha_client
.
post_urlencoded_get_raw
(
# each request
client
=
CaptchaServerHttpClient
(
self
.
hs
)
data
=
yield
client
.
post_urlencoded_get_raw
(
"
http://www.google.com:80/recaptcha/api/verify
"
,
"
http://www.google.com:80/recaptcha/api/verify
"
,
args
=
{
args
=
{
'
privatekey
'
:
private_key
,
'
privatekey
'
:
private_key
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment