Skip to content

Commit

Permalink
fix: content type issue when using spring 3.3.4 (#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfespa17 authored Sep 23, 2024
1 parent f48b710 commit 8534b73
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestClientException;
Expand Down Expand Up @@ -186,8 +185,10 @@ private boolean sendToExecutor(Job job, ExecutorContext executorContext) {
RestTemplate restTemplate = new RestTemplate();
boolean executed = false;
try {
ResponseEntity<ExecutorContext> response = restTemplate.postForEntity(getExecutorUrl(job), executorContext,
ExecutorContext.class);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<ExecutorContext> entity = new HttpEntity<>(executorContext, headers);
ResponseEntity<ExecutorContext> response = restTemplate.postForEntity(getExecutorUrl(job), entity, ExecutorContext.class);
executorContext.setAccessToken("****");
executorContext.setModuleSshKey("****");
log.debug("Sending Job: /n {}", executorContext);
Expand Down

0 comments on commit 8534b73

Please sign in to comment.