Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
ensure maps exposed by Request are immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
pettermahlen committed Dec 2, 2015
1 parent ea9ebff commit c892a55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apollo-api/src/main/java/com/spotify/apollo/RequestValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ private static Request create(
Optional<ByteString> payload) {
return new AutoValue_RequestValue(
method, uri,
parameters,
headers,
ImmutableMap.copyOf(parameters),
ImmutableMap.copyOf(headers),
service,
payload);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ public static Request create(
Optional<String> service,
Map<String, List<String>> parameters,
Map<String, String> headers) {
return new AutoValue_HttpRequest(method, uri, parameters, headers, service, payload);
return new AutoValue_HttpRequest(
method,
uri,
ImmutableMap.copyOf(parameters),
ImmutableMap.copyOf(headers),
service,
payload);
}
}

0 comments on commit c892a55

Please sign in to comment.