mirror of
https://github.com/LBPUnion/UnionPatcher.git
synced 2025-07-31 21:28:41 +00:00
Merge be1993c866
into c45b9ec37e
This commit is contained in:
commit
52e51641bb
2 changed files with 5 additions and 2 deletions
|
@ -132,6 +132,7 @@ public class FilePatchForm : Form {
|
||||||
Gui.CreateOkDialog("Error occurred while patching", "An error occured while patching:\n" + e);
|
Gui.CreateOkDialog("Error occurred while patching", "An error occured while patching:\n" + e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.serverUrl.Text = this.serverUrl.Text.TrimEnd('/');
|
||||||
|
|
||||||
Gui.CreateOkDialog("Success!", "The Server URL has been patched to " + this.serverUrl.Text);
|
Gui.CreateOkDialog("Success!", "The Server URL has been patched to " + this.serverUrl.Text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,10 @@ public static class Patcher {
|
||||||
|
|
||||||
public static byte[] PatchData(byte[] data, string serverUrl) {
|
public static byte[] PatchData(byte[] data, string serverUrl) {
|
||||||
#region Validation
|
#region Validation
|
||||||
if(serverUrl.EndsWith('/')) {
|
// If server URL contains a trailing slash, loop until it's gone.
|
||||||
throw new ArgumentException("URL must not contain a trailing slash!");
|
while (serverUrl.EndsWith('/'))
|
||||||
|
{
|
||||||
|
serverUrl = serverUrl.Remove(serverUrl.Length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempt to create URI to see if it's valid
|
// Attempt to create URI to see if it's valid
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue