Skip to content

Commit

Permalink
PS-42722: Fixing encoding URI components to properly encode symbols n…
Browse files Browse the repository at this point in the history
…ot included by default (#452)
  • Loading branch information
taswartz authored Feb 14, 2024
1 parent 669ded5 commit f6973c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.bullhorn</groupId>
<artifactId>sdk-rest</artifactId>
<version>2.3.4</version>
<version>2.3.5</version>
<packaging>jar</packaging>

<name>Bullhorn REST SDK</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package com.bullhornsdk.data.api.helper;

import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

import javax.xml.transform.Source;

import org.springframework.http.converter.ByteArrayHttpMessageConverter;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.ResourceHttpMessageConverter;
Expand All @@ -17,6 +11,11 @@
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.DefaultUriBuilderFactory;

import javax.xml.transform.Source;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

public class RestTemplateFactory {

private final static RestTemplate restTemplate = createRestTemplate();
Expand All @@ -36,7 +35,10 @@ private static RestTemplate createRestTemplate() {
messageConverters.add(new MappingJackson2HttpMessageConverter());

RestTemplate newTemplate = new RestTemplate(messageConverters);
newTemplate.setUriTemplateHandler(new DefaultUriBuilderFactory());

DefaultUriBuilderFactory defaultUriBuilderFactory = new DefaultUriBuilderFactory();
defaultUriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.VALUES_ONLY);
newTemplate.setUriTemplateHandler(defaultUriBuilderFactory);

return newTemplate;
}
Expand Down

0 comments on commit f6973c3

Please sign in to comment.