Skip to content
Browse files

Ensure that non parseable content gets written out properly;

  • Loading branch information...
1 parent e5fe677 commit a3aea2dac971be53694f606f3c4b25eb55d0f692 Joe Walnes committed Aug 12, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/main/java/org/webbitserver/sitemesh/SiteMeshHandler.java
View
8 src/main/java/org/webbitserver/sitemesh/SiteMeshHandler.java
@@ -34,6 +34,11 @@ public SiteMeshHandler(Selector selector,
protected void postProcessBuffer(HttpRequest httpRequest, HttpResponse httpResponse, HttpControl httpControl, CharBuffer buffer)
throws IOException {
+ if (buffer == null) {
+ httpResponse.end();
+ return;
+ }
+
WebbitSiteMeshContext context = createContext(httpRequest, httpControl, contentProcessor);
applyDecorator(
@@ -52,8 +57,9 @@ private void applyDecorator(final WebbitSiteMeshContext context, final CharBuffe
final HttpHandler[] decoratorHandlers, final int currentDecorator,
final HttpRequest httpRequest, final HttpResponse httpResponse, final HttpControl httpControl) {
if (content == null) {
+
// Content could not be parsed: Write original content
- httpResponse.content(original.toString());
+ httpResponse.content(original.toString()).end();
} else {
// Apply decorator...

0 comments on commit a3aea2d

Please sign in to comment.
Something went wrong with that request. Please try again.