diff options
Diffstat (limited to 'juick-notifications/src/main/java')
-rw-r--r-- | juick-notifications/src/main/java/com/juick/components/MPNSClient.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/MPNSClient.java b/juick-notifications/src/main/java/com/juick/components/MPNSClient.java index 0c136af6..646c7f93 100644 --- a/juick-notifications/src/main/java/com/juick/components/MPNSClient.java +++ b/juick-notifications/src/main/java/com/juick/components/MPNSClient.java @@ -12,6 +12,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.RestTemplate; +import org.springframework.web.util.UriComponentsBuilder; import javax.annotation.PostConstruct; import javax.inject.Inject; @@ -71,7 +72,8 @@ public class MPNSClient { httpHeaders.set("X-WNS-Type", "wns/toast"); HttpEntity<String> requestEntity = new HttpEntity<>(xml, httpHeaders); try { - wnsService.exchange(url, HttpMethod.POST, requestEntity, Void.class); + UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url); + wnsService.exchange(builder.build(true).toUri(), HttpMethod.POST, requestEntity, Void.class); } catch (HttpClientErrorException ex) { HttpStatus statusCode = ex.getStatusCode(); if (statusCode == HttpStatus.GONE) { |