From 97d017a9e7f829e2a52ccbbd8b844d251df94f2a Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 14 Jan 2025 16:23:21 -0600 Subject: [PATCH] Tell Spring Boot to use the simple HttpURLConnection for RestClient, like in Spring boot 3.3 --- .../src/main/resources/application.properties | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dspace-server-webapp/src/main/resources/application.properties b/dspace-server-webapp/src/main/resources/application.properties index 8233298ef0b0..0d9b9cd836ec 100644 --- a/dspace-server-webapp/src/main/resources/application.properties +++ b/dspace-server-webapp/src/main/resources/application.properties @@ -135,3 +135,15 @@ spring.servlet.multipart.max-file-size = 512MB # Maximum size of a multipart request (i.e. max total size of all files in one request) (default = 10MB) spring.servlet.multipart.max-request-size = 512MB + +################################## +# Spring Boot's HTTP Client configuration (for RestClient and RestTemplate) +# https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.4-Release-Notes#restclient-and-resttemplate +# +# "simple" tells Spring Boot to use JDK's HttpURLConnection (SimpleClientHttpRequestFactory) +# We have to configure this explicitly for DSpace because Spring Boot's autoconfiguration will attempt to +# use Jetty or similar if found on the classpath (and Jetty is on the classpath for Handle Server, etc) +spring.http.client.factory = simple +# "dont_follow" tells Spring Boot not to follow any redirects itself, but instead return the 3xx code to +# the user's browser. +spring.http.client.redirects = dont_follow \ No newline at end of file