Apparently people expect Maps to be modifiable
This strikes me as a particularly poor assumption, but
a little bird tells me that this is expected.
Closes
import static java.nio.charset.StandardCharsets.UTF_8;
-import com.google.common.collect.ImmutableMap;
-
import org.openqa.grid.common.exception.GridException;
import org.openqa.grid.internal.ExternalSessionKey;
import org.openqa.grid.internal.Registry;
import java.io.Reader;
import java.io.StringReader;
+import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
@@ -71,7 +70,9 @@ public ExternalSessionKey extractSession() {
Capabilities caps = payload.stream()
.findFirst()
.orElseThrow(() -> new GridException("No capabilities found in request: " + json));
- return ImmutableMap.copyOf(caps.asMap());
+ Map<String, Object> toReturn = new HashMap<>();
+ toReturn.putAll(caps.asMap());
+ return toReturn;
} catch (GridException e) {
throw e;
} catch (Exception e) {
