We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c354f5 commit b06eb34Copy full SHA for b06eb34
src/lib.rs
@@ -112,7 +112,15 @@ fn handle_connection(
112
);
113
let response = match response {
114
Some(s) if s.contains("<head>") => s.replace("<head>", &format!("<head>{}", script)),
115
- Some(s) => s.replace("<body>", &format!("<head>{}</head><body>", script)),
+ Some(s) if s.contains("<body>") => {
116
+ s.replace("<body>", &format!("<head>{}</head><body>", script))
117
+ }
118
+ Some(s) => {
119
+ log::warn!(
120
+ "`response` does not contain a body or head element. Prepending a head element..."
121
+ );
122
+ format!("<head>{}</head>{}", script, s)
123
124
None => format!(
125
"<html><head>{}</head><body>Please return to the app.</body></html>",
126
script
0 commit comments