|
|
@@ -9,14 +9,14 @@ def main_view_file(data = ''):
|
|
|
curs.execute(db_change("select data from other where name = 'robot_default'"))
|
|
|
db_data = curs.fetchall()
|
|
|
if db_data and db_data[0][0] != '':
|
|
|
- return typing.Union[str, werkzeug.wrappers.response.Response](get_default_robots_txt(), mimetype = 'text/plain')
|
|
|
+ return flask.Response(get_default_robots_txt(), mimetype = 'text/plain')
|
|
|
else:
|
|
|
curs.execute(db_change("select data from other where name = 'robot'"))
|
|
|
db_data = curs.fetchall()
|
|
|
if db_data:
|
|
|
- return typing.Union[str, werkzeug.wrappers.response.Response](db_data[0][0], mimetype = 'text/plain')
|
|
|
+ return flask.Response(db_data[0][0], mimetype = 'text/plain')
|
|
|
else:
|
|
|
- return typing.Union[str, werkzeug.wrappers.response.Response](get_default_robots_txt(), mimetype = 'text/plain')
|
|
|
+ return flask.Response(get_default_robots_txt(), mimetype = 'text/plain')
|
|
|
elif os.path.exists(data):
|
|
|
if re.search(r'\.txt$', data, flags = re.I):
|
|
|
return flask.send_from_directory('./', data, mimetype = 'text/plain')
|