Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dariah
search
Commits
adc6a035
Commit
adc6a035
authored
Jul 15, 2021
by
Gradl, Tobias
Browse files
441: Fix issues related to deployment of upcoming v4-release (OPENED)
Task-Url:
#441
parent
f765b540
Changes
2
Hide whitespace changes
Inline
Side-by-side
search-core/src/main/java/eu/dariah/de/search/api/client/base/BaseApiClientImpl.java
View file @
adc6a035
package
eu.dariah.de.search.api.client.base
;
import
java.io.IOException
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
...
...
@@ -109,7 +110,23 @@ public abstract class BaseApiClientImpl<TBase, TExt> implements ApiClient {
ApiStatusPojo
result
=
new
ApiStatusPojo
();
Stopwatch
sw
=
new
Stopwatch
().
start
();
try
{
HttpURLConnection
connection
=
(
HttpURLConnection
)
new
URL
(
this
.
getPingUrl
()).
openConnection
();
String
location
;
URL
baseURL
=
new
URL
(
this
.
getPingUrl
());
URL
nextURL
;
HttpURLConnection
connection
=
(
HttpURLConnection
)
baseURL
.
openConnection
();
int
redirects
=
0
;
while
(
connection
.
getResponseCode
()==
HttpURLConnection
.
HTTP_MOVED_PERM
||
connection
.
getResponseCode
()==
HttpURLConnection
.
HTTP_MOVED_TEMP
)
{
if
(++
redirects
>
10
)
{
throw
new
IOException
(
"Too many redirects; connect cancelled"
);
}
location
=
connection
.
getHeaderField
(
"Location"
);
nextURL
=
new
URL
(
baseURL
,
location
);
// Handle relative URLs
baseURL
=
nextURL
;
connection
=
(
HttpURLConnection
)
baseURL
.
openConnection
();
}
result
.
setStatusCode
(
connection
.
getResponseCode
());
result
.
setRoundtime
(
sw
.
getElapsedTime
());
result
.
setAccessible
(
true
);
...
...
resources
@
af2a4c85
Compare
45dab026
...
af2a4c85
Subproject commit
45dab02681cc7a853e706618f76344d22d3f445b
Subproject commit
af2a4c85bcf339986256c41090cbf4fac7c4aaa2
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment