disallow search engine to crawlers

This commit is contained in:
Thibault Duplessis 2014-12-08 01:14:03 +01:00
parent b8e41ffc58
commit 463e1e2cdc
2 changed files with 4 additions and 2 deletions

View file

@ -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(

View file

@ -17,7 +17,7 @@ moreJs = moreJs,
moreCss = moreCss) {
<div class="content_box no_padding">
<h1 class="title">@trans.advancedSearch()</h1>
<form class="search" action="@routes.Game.search()" method="get">
<form rel="nofollow" class="search" action="@routes.Game.search()" method="get">
<table>
<tr>
<th>