From bc75e86074c181a7d0b2d867f1648a5b0bd269b2 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Mon, 8 Dec 2014 14:59:23 -0800 Subject: [PATCH] Adding ratelimit to friends list. --- apps/social/views.py | 2 ++ config/debug_haproxy.conf | 1 + 2 files changed, 3 insertions(+) diff --git a/apps/social/views.py b/apps/social/views.py index ca419badc..02829139d 100644 --- a/apps/social/views.py +++ b/apps/social/views.py @@ -31,6 +31,7 @@ from utils.view_functions import required_params from utils.story_functions import format_story_link_date__short from utils.story_functions import format_story_link_date__long from utils.story_functions import strip_tags +from utils.ratelimit import ratelimit from utils import jennyholzer from vendor.timezones.utilities import localtime_for_timezone @@ -995,6 +996,7 @@ def load_follow_requests(request): 'request_profiles': request_profiles, } +@ratelimit(minutes=1, requests=10) @json.json_view def load_user_friends(request): user = get_user(request.user) diff --git a/config/debug_haproxy.conf b/config/debug_haproxy.conf index eb5e04e09..1bc155d45 100644 --- a/config/debug_haproxy.conf +++ b/config/debug_haproxy.conf @@ -16,6 +16,7 @@ defaults mode http option forwardfor option http-server-close + option httpclose # option log-health-checks option log-separate-errors option httplog