elysiajs/elysia-html

Regexp to detect HTML is stateful

Closed this issue · 1 comments

The regular expression to detect whether the content resambles HTML uses the global flag, which makes it stateful. So, from time to time (depending on the content-length) the regular expression finally reaches the end and returns false.

Although there's a fix on #12, it seems to me that a slightly more reliable check would be to look for <!doctype html> or <html>.