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

Fix scrubbing for rare cases #465

Merged
merged 4 commits into from
Feb 23, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Resources/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ http {
server app:8000 fail_timeout=0;
}

limit_req_zone $binary_remote_addr zone=api:10m rate=2r/s;
# limit_req_zone $binary_remote_addr zone=api:10m rate=2r/s;

server {
listen 80 deferred;
Expand Down Expand Up @@ -72,7 +72,7 @@ http {
add_header Cache-Control "public";
add_header Pragma public;

limit_req zone=api burst=10;
# limit_req zone=api burst=10;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
12 changes: 6 additions & 6 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@
'PAGE_SIZE': 20,

'PAGINATE_BY': 20,
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttling.AnonRateThrottle',
),
'DEFAULT_THROTTLE_RATES': {
'anon': '1000/hour'
}
# 'DEFAULT_THROTTLE_CLASSES': (
# 'rest_framework.throttling.AnonRateThrottle',
# ),
# 'DEFAULT_THROTTLE_RATES': {
# 'anon': '1000/hour'
# }
}
6 changes: 5 additions & 1 deletion data/v2/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ def scrub_str(string):
if group[0]:
sub = group[0]
else:
sub = group[1].split(":")[1]
sub = group[1].split(":")
if len(sub) >= 2:
sub = sub[1]
else:
sub = sub[0]
sub = sub.replace("-", " ")
string = re.sub(SUB_RGX, sub, string, 1)
return string
Expand Down