2014-04-26 09:18:56 +00:00
|
|
|
package Robots
|
|
|
|
|
2014-10-19 17:19:11 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github.com/SommerEngineering/Ocean/Log"
|
|
|
|
LM "github.com/SommerEngineering/Ocean/Log/Meta"
|
|
|
|
"github.com/SommerEngineering/Ocean/Shutdown"
|
|
|
|
"net/http"
|
|
|
|
)
|
2014-04-26 09:18:56 +00:00
|
|
|
|
2015-06-17 15:44:52 +00:00
|
|
|
// Handler for the access to the robots.txt.
|
2014-04-26 09:18:56 +00:00
|
|
|
func HandlerRobots(response http.ResponseWriter, request *http.Request) {
|
2015-06-17 15:44:52 +00:00
|
|
|
|
|
|
|
// Case: The system goes down now?
|
2014-04-26 09:18:56 +00:00
|
|
|
if Shutdown.IsDown() {
|
|
|
|
http.NotFound(response, request)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameNETWORK, `The robots.txt was requested.`, request.RemoteAddr)
|
|
|
|
fmt.Fprintf(response, `%s`, robotsContent)
|
|
|
|
}
|