Confusing error for malformed HTML (duplicate head tag)
まだ誰も着手していません。
評価
調査の方向性
Reproduce the failure using the attached broken2.html.txt and trace the livereload HTML script-injection path that produces Tornado's Content-Length error. The issue provides no source file or test entry point; done means malformed HTML yields robust behavior or a clear, user-facing error instead of the confusing server traceback.
索引モデルが issue の本文から書いたものです。
説明
Livereload gives confusing error messages when failing to inject its script tag into malformed HTML. See attached for an example of an HTML with a duplicate <head> tag.
[E 230918 10:51:35 web:1789] Uncaught exception GET /broken2.html (127.0.0.1)
HTTPServerRequest(protocol='http', host='127.0.0.1:35729', method='GET', uri='/broken2.html', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/tornado/web.py", line 1704, in _execute
result = await result
File "/usr/lib/python3/dist-packages/tornado/web.py", line 2648, in get
await self.flush()
File "/usr/lib/python3/dist-packages/tornado/web.py", line 1094, in flush
return self.request.connection.write_headers(
File "/usr/lib/python3/dist-packages/tornado/http1connection.py", line 464, in write_headers
data += self._format_chunk(chunk)
File "/usr/lib/python3/dist-packages/tornado/http1connection.py", line 475, in _format_chunk
raise httputil.HTTPOutputError(
tornado.httputil.HTTPOutputError: Tried to write more data than Content-Length
[E 230918 10:51:35 web:1197] Cannot send error response after headers written
I understand the real error is mine and livereload works if I fix the HTML. But debugging it was confusing, particularly since I am new to livereload. The error output looks like some abstruse failure of the details of Tornado serving, not a simple user input problem.
I imagine injecting Javascript into all kinds of bad user input is hard! I suggest either doing something robust and simple so it's unlikely to fail or else some defensive error handling to catch this kind of problem and give the user an easy to understand error.
Thank you for livereload!
broken2.html.txt
- 主要言語
- Python
- スター
- 1.1k
- フォーク
- 148
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lepture/python-livereload のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
lepture/python-livereload#159 · リアクション 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
lepture/python-livereload#288 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
lepture/python-livereload#283 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
lepture/python-livereload#282 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
lepture/python-livereload#279 ·
lepture/python-livereload の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mishraprafful/multihull#150 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
python-caldav/caldav#735 ·
メンテナーはふだん 1 日以内に返信
-
bug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mealie-recipes/mealie#8682 ·
メンテナーはふだん 1 日以内に返信
-
good first issue lane:repo
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100