Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Source/HedgeModManager/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public static string NormalizePath(string path)
return path.Replace('\\', '/');
}

/// <summary>
/// Ensures that the specified path ends with a trailing forward slash "/"
/// </summary>
public static string EnsureTrailingSlash(string baseHost)
{
return baseHost.TrimEnd('/') + '/';
}

/// <summary>
/// Combines a base URL path and a file path into a single URL
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Source/HedgeModManager/ModGeneric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void Parse(Ini file)
var server = mainSection.Get("UpdateServer", string.Empty);
if (!string.IsNullOrEmpty(server))
{
if (Uri.TryCreate(server, UriKind.Absolute, out Uri? uri))
if (Uri.TryCreate(Helpers.EnsureTrailingSlash(server), UriKind.Absolute, out Uri? uri))
{
Updater = new UpdateSourceMulti(this, uri);
}
Expand Down