Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update injectCode.ts to append code when closing tags not detected #154

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

trusktr
Copy link

@trusktr trusktr commented Feb 5, 2025

Forces the injector to always inject the fiveserver client script, even if a head/html/body tag is not found.

Comment on lines -116 to +120
if (!inject.injectTag) return next()
else {
res.type('html')
res.setHeader('Content-Length', inject.data.length)
res.send(inject.data)
}
res.type('html')
res.setHeader('Content-Length', inject.data.length)
res.send(inject.data)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditional check here is removed because now the injection always happens, regardless if a closing tag was found or not.

Comment on lines +51 to +52
} else {
data = data + '\n' + this.code
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fall back to appending the injection script if no closing tag is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant