Permalink
Browse files

Error is set into a separate cookie

  • Loading branch information...
pepite committed Mar 6, 2010
1 parent 82a8c8c commit b737d753a5f4af3407befb04c663b0077c3e8bd1
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/play/modules/netty/PlayHandler.java
@@ -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;
@@ -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) {

0 comments on commit b737d75

Please sign in to comment.