Jelajahi Sumber

사용자 지정 404 페이지가 HTTP 상태 코드 404를 반환하도록 수정

Denevola 4 tahun lalu
induk
melakukan
f07e60112f
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      route/main_error_404.py

+ 1 - 1
route/main_error_404.py

@@ -2,6 +2,6 @@ from .tool.func import *
 
 def main_error_404(e):
     if os.path.exists('404.html') and flask.request.path != '/':
-        return open('404.html', encoding='utf8').read()
+        return open('404.html', encoding='utf8').read(), 404
     else:
         return redirect('/w/' + wiki_set(2))