我发现Java的dev_appserver
与实时App Engine服务器之间存在不一致。App Engine HTTP状态代码消息
在我的本地开发服务器,我有一个Servlet返回:
return response.sendError(response.SC_BAD_REQUEST, "Please log in to comment");
当我访问的页面,我回去在标题状态码的消息是:
Status Code:400 Please log in to comment
问题当我将它部署到App Engine时。当访问同一个servlet我得到这个“错误的请求”,而不是“请登录后发表评论”:
Status Code:400 Bad Request
,因为它在不出现在内容HTML的Please log in to comment
状态代码的消息,但不是在头开发环境。
这是为什么?
编辑
这里的curl -vvvv
痕迹两个dev_appserver和生产:
dev_appserver卷曲跟踪:
> 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)
生产卷曲跟踪:
> 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
您可以为两个调用devappserver和production添加curl -vvvv跟踪吗? – proppy
@proppy:编辑 –