Confusing error for malformed HTML (duplicate head tag)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 1.1k
- Fork
- 148
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lepture/python-livereload
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
lepture/python-livereload#159 · 3 reazioni ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
lepture/python-livereload#288 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
lepture/python-livereload#283 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
lepture/python-livereload#282 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
lepture/python-livereload#279 ·
Tutte le issue di lepture/python-livereload
Issue simili
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
json_params_matcher fails on falsy top-level JSON primitives (0, False, "")Forse già presa @mayureshsonawane17 l’ha presa oggi. ApertaWaiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Add .devin pluginAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
ayghri/i-have-adhd#249 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
modelscope/FunASR#3762 ·
I maintainer di solito rispondono entro 1 giorno