File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -222,11 +222,16 @@ void ValidateLastUpdate()
222
222
if ( LastUpdate != null )
223
223
{
224
224
var uri = new Uri ( LastUpdate . Url , UriKind . RelativeOrAbsolute ) ;
225
- if ( uri . IsAbsoluteUri )
226
- {
227
- LastUpdate = null ;
228
- LastCheckError = new InvalidDataException ( "Update URL must be relative to channel URL." ) ;
229
- }
225
+
226
+ // All relative URLs are valid
227
+ if ( ! uri . IsAbsoluteUri ) return ;
228
+
229
+ // Official GitHub URLs are valid
230
+ if ( uri . Scheme == "https" && uri . Host == "github.com" && uri . AbsolutePath . StartsWith ( "/openrails/openrails/releases" ) ) return ;
231
+
232
+ // Everything else is invalid
233
+ LastUpdate = null ;
234
+ LastCheckError = new InvalidDataException ( "Update URL must be relative to channel URL or from https://github.com/openrails/openrails/releases." ) ;
230
235
}
231
236
}
232
237
You can’t perform that action at this time.
0 commit comments