Skip to content

Commit

Permalink
small update to controller
Browse files Browse the repository at this point in the history
  • Loading branch information
jarlehansen committed May 24, 2017
1 parent c873b6a commit b539c52
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import org.springframework.web.util.UriComponents;

import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

Expand All @@ -25,14 +24,12 @@
@ConditionalOnProperty(value = SpringfoxLoaderProps.PROPS_SPRINGFOX_ENDPOINTS, havingValue = "true")
public class SpringfoxLoaderController {

private RestTemplate restTemplate;
private RestTemplate restTemplate = new RestTemplate();
private HttpHeaders headers;

@PostConstruct
public void init() {
public SpringfoxLoaderController() {
headers = new HttpHeaders();
headers.put(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, Lists.newArrayList("*"));
restTemplate = new RestTemplate();
}

@GetMapping("/api-docs")
Expand Down

0 comments on commit b539c52

Please sign in to comment.