From 463e1e2cdce5f937b1764044d66eaebb38a53b5d Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Mon, 8 Dec 2014 01:14:03 +0100 Subject: [PATCH] disallow search engine to crawlers --- app/controllers/Game.scala | 4 +++- app/views/game/search.scala.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/Game.scala b/app/controllers/Game.scala index ad4990aa64..19f9766281 100644 --- a/app/controllers/Game.scala +++ b/app/controllers/Game.scala @@ -3,6 +3,7 @@ package controllers import play.api.mvc.Action import lila.app._ +import lila.common.HTTPRequest import lila.game.{ Game => GameModel, GameRepo } import play.api.http.ContentTypes import views._ @@ -16,7 +17,8 @@ object Game extends LilaController with BaseGame { def searchForm = searchEnv.forms.search def search(page: Int) = OpenBody { implicit ctx => - Reasonable(page, 100) { + if (HTTPRequest.isBot(ctx.req)) notFound + else Reasonable(page, 100) { implicit def req = ctx.body makeListMenu flatMap { listMenu => searchForm.bindFromRequest.fold( diff --git a/app/views/game/search.scala.html b/app/views/game/search.scala.html index 9b52e4773f..d28831e01c 100644 --- a/app/views/game/search.scala.html +++ b/app/views/game/search.scala.html @@ -17,7 +17,7 @@ moreJs = moreJs, moreCss = moreCss) {

@trans.advancedSearch()

-