Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Portals committed Jun 25, 2024
1 parent b9ee17e commit fa4aebd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;

@Service
Expand Down Expand Up @@ -62,8 +62,10 @@ record Request(String to, String from, String subject, String body) {}

HttpEntity<Request> entity = new HttpEntity<>(request, headers);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> response =
restTemplate.postForEntity(this.gotifyURL + "/mail", entity, String.class);
LOGGER.info("Gotify responded with " + response.getHeaders() + response.getBody());
try {
restTemplate.postForEntity(this.gotifyURL + "/mail", entity, String.class);
} catch (RestClientException e) {
LOGGER.error(e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<div th:replace="home/page:: me-avatar"></div>
<div th:replace="~{home/page:: me-avatar}"></div>
<div th:replace="~{common/alert :: success('You have uploaded a new avatar')}"></div>

0 comments on commit fa4aebd

Please sign in to comment.