diff --git a/src/main/java/tech/brenoepic/at4j/util/rest/RestRequest.java b/src/main/java/tech/brenoepic/at4j/util/rest/RestRequest.java index 0cf6644..09d0895 100644 --- a/src/main/java/tech/brenoepic/at4j/util/rest/RestRequest.java +++ b/src/main/java/tech/brenoepic/at4j/util/rest/RestRequest.java @@ -104,7 +104,7 @@ public Multimap getQueryParameters() { * @return An array with all used url parameters. */ public String[] getUrlParameters() { - return urlParameters; + return urlParameters.clone(); } /** diff --git a/src/main/java/tech/brenoepic/at4j/util/rest/RestRequestInformationImpl.java b/src/main/java/tech/brenoepic/at4j/util/rest/RestRequestInformationImpl.java index 60312c1..0cb774e 100644 --- a/src/main/java/tech/brenoepic/at4j/util/rest/RestRequestInformationImpl.java +++ b/src/main/java/tech/brenoepic/at4j/util/rest/RestRequestInformationImpl.java @@ -4,6 +4,7 @@ import com.google.common.collect.Multimaps; import java.net.URL; import java.util.Collections; +import java.util.HashMap; import java.util.Map; import java.util.Optional; import tech.brenoepic.at4j.AzureApi; @@ -35,7 +36,7 @@ public RestRequestInformationImpl( this.api = api; this.url = url; this.queryParameters = queryParameter; - this.headers = headers; + this.headers = new HashMap<>(headers); this.body = body; }