File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
core/src/main/java/org/everit/json/schema/loader/internal Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 4
4
import java .io .InputStream ;
5
5
import java .io .UncheckedIOException ;
6
6
import java .net .URL ;
7
+ import java .net .URLConnection ;
7
8
8
9
import org .everit .json .schema .loader .SchemaClient ;
9
10
@@ -15,7 +16,13 @@ public class DefaultSchemaClient implements SchemaClient {
15
16
@ Override
16
17
public InputStream get (final String url ) {
17
18
try {
18
- return (InputStream ) new URL (url ).getContent ();
19
+ URL u = new URL (url );
20
+ URLConnection conn = u .openConnection ();
21
+ String location = conn .getHeaderField ("Location" );
22
+ if (location != null ) {
23
+ return get (location );
24
+ }
25
+ return (InputStream ) conn .getContent ();
19
26
} catch (IOException e ) {
20
27
throw new UncheckedIOException (e );
21
28
}
You can’t perform that action at this time.
0 commit comments