1 Star 0 Fork 27

caofei/python-werkzeug

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-fix-debugger-html.patch 2.06 KB
一键复制 编辑 原始数据 按行查看 历史
caofei 提交于 2023-01-17 09:27 . fix debugger html
From 4a8f76c289d24a13efc9c6eb8b4e09890140ed82 Mon Sep 17 00:00:00 2001
From: David Lord <[email protected]>
Date: Mon, 7 Feb 2022 12:04:14 -0800
Subject: [PATCH] fix debugger html
fix doctype typo
remove unnecessary type attributes
let response set charset
---
src/werkzeug/debug/__init__.py | 2 +-
src/werkzeug/debug/tbtools.py | 10 +++-------
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/werkzeug/debug/__init__.py b/src/werkzeug/debug/__init__.py
index 936a9639..ac513830 100644
--- a/src/werkzeug/debug/__init__.py
+++ b/src/werkzeug/debug/__init__.py
@@ -327,7 +327,7 @@ class DebuggedApplication:
secret=self.secret,
evalex_trusted=is_trusted,
)
- response = Response(html, status=500, content_type="text/html")
+ response = Response(html, status=500, mimetype="text/html")
try:
yield from response(environ, start_response)
diff --git a/src/werkzeug/debug/tbtools.py b/src/werkzeug/debug/tbtools.py
index 17e3b361..7ce69519 100644
--- a/src/werkzeug/debug/tbtools.py
+++ b/src/werkzeug/debug/tbtools.py
@@ -12,19 +12,15 @@ from ..utils import cached_property
from .console import Console
HEADER = """\
-<!DOCTYPE html">
+<!DOCTYPE html>
<html>
<head>
<title>%(title)s // Werkzeug Debugger</title>
- <link rel="stylesheet" href="?__debugger__=yes&amp;cmd=resource&amp;f=style.css"
- type="text/css">
- <!-- We need to make sure this has a favicon so that the debugger does
- not accidentally trigger a request to /favicon.ico which might
- change the application's state. -->
+ <link rel="stylesheet" href="?__debugger__=yes&amp;cmd=resource&amp;f=style.css">
<link rel="shortcut icon"
href="?__debugger__=yes&amp;cmd=resource&amp;f=console.png">
<script src="?__debugger__=yes&amp;cmd=resource&amp;f=debugger.js"></script>
- <script type="text/javascript">
+ <script>
var CONSOLE_MODE = %(console)s,
EVALEX = %(evalex)s,
EVALEX_TRUSTED = %(evalex_trusted)s,
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cao-fei8/python-werkzeug.git
[email protected]:cao-fei8/python-werkzeug.git
cao-fei8
python-werkzeug
python-werkzeug
master

搜索帮助