Skip to content

Commit

Permalink
[Grid]: Handle poorly formed JSON responses
Browse files Browse the repository at this point in the history
Without causing the server to crash.
  • Loading branch information
shs96c committed Aug 25, 2017
1 parent 2be2828 commit 13c1113
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions java/server/src/org/openqa/grid/internal/TestSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.common.io.ByteStreams;
import com.google.common.net.MediaType;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;

import org.apache.http.Header;
import org.apache.http.HttpEntity;
Expand Down Expand Up @@ -359,6 +360,8 @@ private byte[] closeSessionIfNecessary(
}
}
}
} catch (JsonParseException e) {
// Nothing to do --- poorly formed payload.
}

return consumed;
Expand Down

0 comments on commit 13c1113

Please sign in to comment.