Confusing error for malformed HTML (duplicate head tag)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 1.1k
- Forks
- 148
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de lepture/python-livereload
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
lepture/python-livereload#159 · 3 reacciones ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
lepture/python-livereload#288 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
lepture/python-livereload#283 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
lepture/python-livereload#282 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
lepture/python-livereload#279 ·
Todos los issues de lepture/python-livereload
Issues similares
-
needs-human needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
gke-labs/kube-agents#2400 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Device Details tables: FS/SF columns contradict each other (nfet_01v8 Vt row, pfet_01v8 Idsat row)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
google/skywater-pdk#450 ·
-
Drained trajectory arrays are overwritten when the sequence buffer is reusedPosiblemente ocupada @sylvesterkaczmarek la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
google-deepmind/bsuite#56 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
LearningCircuit/local-deep-research#7206 ·
Los mantenedores suelen responder en 1 día
-
[TASK] Document technology stackAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chingu-voyages/V62-tier3-team-33#285 ·
Los mantenedores suelen responder en 1 día