Menu

#2 Server destroys encoding of websites when using RegExFilter

Version 0.28
open
nobody
5
2013-04-05
2013-04-05
David
No

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

Discussion


Log in to post a comment.