Skip to content

Commit

Permalink
Error is set into a separate cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
pepite committed Mar 6, 2010
1 parent 82a8c8c commit b737d75
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/play/modules/netty/PlayHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,15 @@ void saveExceededSizeError(HttpRequest nettyRequest, Response response) {
error.append(response.cookies.get(Scope.COOKIE_PREFIX + "_ERRORS").value);
}
String errorData = URLEncoder.encode(error.toString(), "utf-8");
response.setCookie(Scope.COOKIE_PREFIX + "_ERRORS", errorData);
Http.Cookie c = new Http.Cookie();
c.value = errorData;
c.name = Scope.COOKIE_PREFIX + "_ERRORS";
response.cookies.put(Scope.COOKIE_PREFIX + "_ERRORS", c);
} catch (Exception e) {
throw new UnexpectedException("Flash serialization problem", e);
throw new UnexpectedException("Error serialization problem", e);
}
}
}
}

protected static void addToResponse(Response response, HttpResponse nettyResponse) {
Map<String, Http.Header> headers = response.headers;
Expand Down Expand Up @@ -301,7 +304,7 @@ public static void copyResponse(ChannelHandlerContext ctx, Request request, Resp

public static Request parseRequest(ChannelHandlerContext ctx, HttpRequest nettyRequest) throws Exception {
Logger.trace("parseRequest: begin");
int index = nettyRequest.getUri().indexOf("?");
int index = nettyRequest.getUri().indexOf("?");
String querystring = "";
String path = URLDecoder.decode(nettyRequest.getUri(), "UTF-8");
if (index != -1) {
Expand Down

0 comments on commit b737d75

Please sign in to comment.