19
19
import java .util .Collections ;
20
20
import java .util .Date ;
21
21
import java .util .List ;
22
+ import java .util .Locale ;
22
23
import java .util .Optional ;
23
24
import java .util .TimeZone ;
24
25
import java .util .concurrent .CompletableFuture ;
@@ -109,7 +110,7 @@ public List<Satellite> loadNewLaunches(long lastModified) throws NotModifiedExce
109
110
Optional <String > lastModifiedOnServer = response .headers ().firstValue ("Last-Modified" );
110
111
lastModified = 0 ;
111
112
if (lastModifiedOnServer .isPresent ()) {
112
- SimpleDateFormat sdf = new SimpleDateFormat ("EEE, dd MMM yyyy HH:mm:ss zzz" );
113
+ SimpleDateFormat sdf = new SimpleDateFormat ("EEE, dd MMM yyyy HH:mm:ss zzz" , Locale . US );
113
114
sdf .setTimeZone (TimeZone .getTimeZone ("UTC" ));
114
115
try {
115
116
lastModified = sdf .parse (lastModifiedOnServer .get ()).getTime ();
@@ -129,7 +130,7 @@ public List<Satellite> loadNewLaunches(long lastModified) throws NotModifiedExce
129
130
throw new IllegalStateException (e );
130
131
}
131
132
}
132
-
133
+
133
134
public List <Satellite > loadSatellites (long lastModified ) throws NotModifiedException {
134
135
return loadSatellites (lastModified , null );
135
136
}
@@ -156,7 +157,7 @@ public List<Satellite> loadSatellites(long lastModified, Boolean all) throws Not
156
157
Optional <String > lastModifiedOnServer = response .headers ().firstValue ("Last-Modified" );
157
158
lastModified = 0 ;
158
159
if (lastModifiedOnServer .isPresent ()) {
159
- SimpleDateFormat sdf = new SimpleDateFormat ("EEE, dd MMM yyyy HH:mm:ss zzz" );
160
+ SimpleDateFormat sdf = new SimpleDateFormat ("EEE, dd MMM yyyy HH:mm:ss zzz" , Locale . US );
160
161
sdf .setTimeZone (TimeZone .getTimeZone ("UTC" ));
161
162
try {
162
163
lastModified = sdf .parse (lastModifiedOnServer .get ()).getTime ();
@@ -407,7 +408,7 @@ private HttpRequest.Builder createRequest(String path, long lastModified) {
407
408
result .header ("User-Agent" , R2Cloud .getVersion () + " leosatdata.com" );
408
409
result .header ("Authorization" , config .getProperty ("r2cloud.apiKey" ));
409
410
if (lastModified != 0 ) {
410
- SimpleDateFormat sdf = new SimpleDateFormat ("EEE, dd MMM yyyy HH:mm:ss zzz" );
411
+ SimpleDateFormat sdf = new SimpleDateFormat ("EEE, dd MMM yyyy HH:mm:ss zzz" , Locale . US );
411
412
sdf .setTimeZone (TimeZone .getTimeZone ("UTC" ));
412
413
result .header ("If-Modified-Since" , sdf .format (new Date (lastModified )));
413
414
}
0 commit comments