Commit 76aea9c0 authored by jpic ∞'s avatar jpic ∞ 💾
Browse files

Scripts in head

parent b8fb18c2
......@@ -30,7 +30,7 @@ class StaticMiddleware:
continue
module = script.get('module', True)
response.content = response.content.replace(
b'</body>',
b'</head>',
b''.join([
b'<script '
b'type="module"' if module else b'nomodule',
......@@ -39,7 +39,7 @@ class StaticMiddleware:
src,
b'">',
b'</script>',
b'</body>',
b'</head>',
])
)
loaded.append(src)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment