Fix to consider XML too #1907

This commit is contained in:
iliajie
2023-05-16 14:41:09 +03:00
parent ab44aa8023
commit c92395176f

View File

@@ -84,17 +84,15 @@ if ($ENV{'PATH_INFO'}) {
print "Content-length: $st[7]\n";
print "X-Content-Type-Options: nosniff\n";
print "Content-type: $type\n\n";
if ($type =~ /text\/html/i) {
local $/;
$buffer = <FILE>;
print &filter_javascript($buffer);
}
else {
while(read(FILE, $buffer, &get_buffer_size_binary())) {
print $buffer;
while(read(FILE, $buffer, &get_buffer_size_binary())) {
if ($type =~ /text\/html|xml/i) {
print &filter_javascript($buffer);
}
else {
print("$buffer");
}
close(FILE);
}
close(FILE);
}
# Switch back to root