def DoPOST(self, data): if data.GetLocation() == '/bf/gme/action/Dynamic_background.php': http = HTTPData() http.AppendData(Features.Base64Crypt(Config.GetWallpaper())) http.SetContentType('application/json') self.client.SendHTTPData(http) else: Logger.PrintError('Unknown location %s from %s' % (data.GetLocation(), self.client.GetAddress())) self.Send404()
def DoGET(self, data): if data.GetLocation() == '/bf/web/terms.htm': Features.SendTerms(self.client) elif data.GetLocation() == '/bf/gme/action/Dynamic_background.php': http = HTTPData() http.AppendData(Features.Base64Crypt(Config.GetWallpaper())) http.SetContentType('application/json') self.client.SendHTTPData(http) elif data.GetLocation() == '/shutdown_server': if self.client.GetAddress() == '127.0.0.1': http = HTTPData() http.AppendData('Shutting down...') self.client.SendHTTPData(http) self.client.Close() self.StopServer() else: self.Send404() else: Logger.PrintError('Unknown location %s from %s' % (data.GetLocation(), self.client.GetAddress())) self.Send404()