I found a mismatch between Java dev_appserver and the Live Engine App server.
On my local development server, I have a Servlet that returns:
return response.sendError(response.SC_BAD_REQUEST, "Please log in to comment");
When I access the page, I return a message with a status code in the header, which:
Status Code:400 Please log in to comment
The problem occurs when I deploy this to App Engine. When accessing the same servlet, I get this "bad request" instead of "Please log in to comment":
Status Code:400 Bad Request
The status message Please log in to comment Status Code appears in the HTML content, but not in the header, as in the development environment.
Why is this?
Edit
Here's the curl -vvvv trace curl -vvvv for dev_appserver and production:
dev_appserver curl trace:
> POST /add-comment HTTP/1.1 > User-Agent: Mozilla/4.0 > Host: localhost:8080 > Accept: */* > Content-Length: 9 > Content-Type: application/x-www-form-urlencoded > < HTTP/1.1 400 Please log in to comment < Content-Type: text/html; charset=iso-8859-1 < Cache-Control: must-revalidate,no-cache,no-store < Content-Length: 1406 < Server: Jetty(6.1.x)
Curl Production Curve:
> POST /add-comment HTTP/1.1 > User-Agent: Mozilla/4.0 > Host: www.xxx.org > Accept: */* > Content-Length: 9 > Content-Type: application/x-www-form-urlencoded > < HTTP/1.1 400 Bad Request < Content-Type: text/html; charset=utf-8 < Vary: Accept-Encoding < Date: Thu, 18 Aug 2011 14:04:26 GMT < Server: Google Frontend < Cache-Control: private < Transfer-Encoding: chunked