我發現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:編輯 –