File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
src/main/java/airsquared/blobsaver/app Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 2525import java .io .BufferedReader ;
2626import java .io .IOException ;
2727import java .io .InputStreamReader ;
28+ import java .net .HttpURLConnection ;
2829import java .net .URI ;
2930import java .net .URL ;
3031import java .net .URLConnection ;
@@ -173,11 +174,17 @@ private void ensureOpen() throws IOException {
173174 if (pos > 0 )
174175 connection .addRequestProperty ("Range" , "bytes=" + pos + "-" );
175176 ch = Channels .newChannel (connection .getInputStream ());
177+ if (connection instanceof HttpURLConnection c && c .getResponseCode () != 200 ) {
178+ throw new IOException ("HTTP Response was " + c .getResponseCode () + " " + Utils .defIfNull (c .getResponseMessage (), "" ));
179+ }
176180 String resp = connection .getHeaderField ("Content-Range" );
177181 if (resp != null ) {
178182 length = Long .parseLong (resp .split ("/" )[1 ]);
179183 } else {
180184 resp = connection .getHeaderField ("Content-Length" );
185+ if (resp == null ) {
186+ throw new IOException ("No Content-Range or Content-Length header" );
187+ }
181188 length = Long .parseLong (resp );
182189 }
183190 }
Original file line number Diff line number Diff line change @@ -108,11 +108,13 @@ protected String call() throws TSSException {
108108 saveFor (iosVersion , args );
109109 } catch (TSSException e ) {
110110 if (manualVersion == null && manualIpswURL == null ) {
111- if (e .getMessage ().contains ("not being signed" )) {
111+ var msg = e .getMessage ();
112+ if (msg .contains ("not being signed" )) {
112113 System .err .println ("Warning: ignoring unsigned version; API is likely out of date" );
113114 continue ; // ignore not being signed (API might not be updated)
114115 }
115- if (e .getMessage ().contains ("Failed to load manifest" ) && includeBetas
116+ if ((msg .contains ("Failed to load manifest" ) || msg .contains ("Unable to extract BuildManifest" ))
117+ && includeBetas
116118 && containsIgnoreCase (iosVersion .versionString (), "beta" )
117119 && iosVersion .ipswURL ().contains ("developer.apple" )) {
118120 System .err .println ("Warning: ignoring developer beta" );
You can’t perform that action at this time.
0 commit comments