Skip to content

Commit d063ad4

Browse files
authored
Update DevServer to handle empty POST requests (#1068)
Set Content-Length to 0 and close output stream after writing. So that mvn appengine:stop works again (same in Gradle)
1 parent d664ba9 commit d063ad4

File tree

1 file changed

+2
-1
lines changed
  • appengine-plugins-core/src/main/java/com/google/cloud/tools/appengine/operations

1 file changed

+2
-1
lines changed

appengine-plugins-core/src/main/java/com/google/cloud/tools/appengine/operations/DevServer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ public void stop(StopConfiguration configuration) throws AppEngineException {
205205
connection.setDoOutput(true);
206206
connection.setDoInput(true);
207207
connection.setRequestMethod("POST");
208-
connection.getOutputStream().write('\n');
208+
connection.setRequestProperty("Content-Length", "0");
209+
connection.getOutputStream().close();
209210
connection.disconnect();
210211
int responseCode = connection.getResponseCode();
211212
if (responseCode < 200 || responseCode > 299) {

0 commit comments

Comments
 (0)