Skip to content

Commit 9a0666e

Browse files
authored
Merge pull request #259 from Lucas-C/patch-1
Fix LiveScriptInjector so that <script> is never injected twice
2 parents 028d75f + 24a6467 commit 9a0666e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

livereload/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def __init__(self, request):
105105

106106
def transform_first_chunk(self, status_code, headers, chunk, finishing):
107107
if HEAD_END in chunk:
108-
chunk = chunk.replace(HEAD_END, self.script + HEAD_END)
108+
chunk = chunk.replace(HEAD_END, self.script + HEAD_END, 1)
109109
if 'Content-Length' in headers:
110110
length = int(headers['Content-Length']) + len(self.script)
111111
headers['Content-Length'] = str(length)

0 commit comments

Comments
 (0)