Javadev_appserver
とライブのAppEngineサーバーの間に不整合が見つかりました。
ローカル開発サーバーには、次を返すサーブレットがあります。
return response.sendError(response.SC_BAD_REQUEST, "Please log in to comment");
このページにアクセスすると、ヘッダーにステータスコードメッセージが返されます。これは次のとおりです。
Status Code:400 Please log in to comment
これをAppEngineにデプロイすると問題が発生します。同じサーブレットにアクセスすると、「ログインしてコメントしてください」ではなく、「不正なリクエスト」が表示されます。
Status Code:400 Bad Request
ステータスコードメッセージはPlease log in to comment
コンテンツHTMLに表示されますが、開発環境の場合のようにヘッダーには表示されません。
どうしてこれなの?
編集
curl -vvvv
dev_appserverと本番の両方のトレースは次のとおりです。
dev_appserver curlトレース:
> 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