We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 757a5ab commit 2e53e4cCopy full SHA for 2e53e4c
lmfdb/app.py
@@ -308,31 +308,6 @@ def netloc_redirect():
308
return redirect(urlunparse(replaced), code=302)
309
310
311
-@cached_function
312
-def bad_bots_list():
313
- return [
314
- elt.lower()
315
- for elt in [
316
- "The Knowledge AI",
317
- "Wolfram",
318
- "petalbot",
319
- "Bytespider",
320
- "Sogou",
321
- "MJ12bot",
322
- "Amazonbot",
323
- "meta",
324
- "facebook",
325
- ]
326
327
-
328
329
-@app.before_request
330
-def badbot():
331
- ua = request.user_agent.string.lower()
332
- for elt in bad_bots_list():
333
- if elt in ua:
334
- return render_template("404.html", title='Too many requests'), 429
335
336
337
def timestamp():
338
return '[%s UTC]' % time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())
0 commit comments