Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

/**
* Thin wrapper class over the JRE URL class to assist in testing
Expand All @@ -22,6 +23,10 @@ public AwsFargateMetadataFetcher(String metadataUrl) throws MalformedURLExceptio
}

public InputStream openStream() throws IOException {
return (url == null ? null : url.openStream());
URLConnection connection = url.openConnection();
connection.setConnectTimeout(5000);
connection.setReadTimeout(5000);

return connection.getInputStream();
}
}
Loading