With newer Jetty web server a POST without Content-Length header emits an error 411. So the mvn appengine:stop command does not work anymore as AppEngine updated Jetty version to latest.
The fix is to explicitly setting Content-Length: 0 and closing the output stream without writing any newlines. This ensures that the shutdown request is strictly compliant with HTTP standards and avoids the 411 Length Required error on newer Jetty versions.
// ...
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Length", "0"); // Explicitly set length
connection.getOutputStream().close(); // Write empty body
connection.disconnect();
// ...
in
|
adminServerUrl = new URL("http", host, port, "/_ah/admin/quit"); |
near the POST to "/_ah/admin/quit" URL
With newer Jetty web server a POST without Content-Length header emits an error 411. So the mvn appengine:stop command does not work anymore as AppEngine updated Jetty version to latest.
The fix is to explicitly setting Content-Length: 0 and closing the output stream without writing any newlines. This ensures that the shutdown request is strictly compliant with HTTP standards and avoids the 411 Length Required error on newer Jetty versions.
in
appengine-plugins/appengine-plugins-core/src/main/java/com/google/cloud/tools/appengine/operations/DevServer.java
Line 203 in d664ba9