Skip to content

Commit cac00b3

Browse files
authored
Fixed mod updates not fetching correct URL (#105)
1 parent 8653d34 commit cac00b3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Source/HedgeModManager/Helpers.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ public static string NormalizePath(string path)
2727
return path.Replace('\\', '/');
2828
}
2929

30+
/// <summary>
31+
/// Ensures that the specified path ends with a trailing forward slash "/"
32+
/// </summary>
33+
public static string EnsureTrailingSlash(string baseHost)
34+
{
35+
return baseHost.TrimEnd('/') + '/';
36+
}
37+
3038
/// <summary>
3139
/// Combines a base URL path and a file path into a single URL
3240
/// </summary>

Source/HedgeModManager/ModGeneric.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void Parse(Ini file)
9797
var server = mainSection.Get("UpdateServer", string.Empty);
9898
if (!string.IsNullOrEmpty(server))
9999
{
100-
if (Uri.TryCreate(server, UriKind.Absolute, out Uri? uri))
100+
if (Uri.TryCreate(Helpers.EnsureTrailingSlash(server), UriKind.Absolute, out Uri? uri))
101101
{
102102
Updater = new UpdateSourceMulti(this, uri);
103103
}

0 commit comments

Comments
 (0)