Update UnionPatcher/Patcher.cs

Co-authored-by: Josh <josh@slendy.pw>
This commit is contained in:
McMistrzYT 2023-02-09 18:59:22 +01:00 committed by GitHub
parent 9a19005765
commit 4db23adae4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,10 +21,8 @@ public static class Patcher {
public static byte[] PatchData(byte[] data, string serverUrl) {
#region Validation
// If server URL contains a trailing slash, loop until it's gone.
while (serverUrl.EndsWith('/'))
{
serverUrl = serverUrl.Remove(serverUrl.Length - 1);
if(serverUrl.EndsWith('/')) {
throw new ArgumentException("URL must not contain a trailing slash!");
}
// Attempt to create URI to see if it's valid