Server destroys encoding of websites when using RegExFilter
Brought to you by:
luelljoc
The class PawRegFilter has a bug in its method public byte[] filter(Request request, MimeHeaders headers, byte[] content)
After applying the filter, the encoding is ignored and the result is written back to the client with result.getBytes();
It should be result.getBytes(encoding);
so change the line 190 return result.getBytes();
to
if(encoding != null)
{
try {
return result.getBytes(encoding);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return result.getBytes();
Regards
David